diff --git a/Kernel/Config/Files/XML/Framework.xml b/Kernel/Config/Files/XML/Framework.xml
index a030c9b6d5..6c26b0fdb0 100644
--- a/Kernel/Config/Files/XML/Framework.xml
+++ b/Kernel/Config/Files/XML/Framework.xml
@@ -550,6 +550,13 @@
- 6000
+
+ Limits the number of options for modernized selection fields. If this limit will be exceeded, the selection field will for performance reasons be shown as non-modernized.
+ Frontend::Base
+
+ - 1000
+
+
Turns on drag and drop for the main navigation.
Frontend::Base
diff --git a/Kernel/Language/de.pm b/Kernel/Language/de.pm
index e25f81d783..ddf2d55a26 100644
--- a/Kernel/Language/de.pm
+++ b/Kernel/Language/de.pm
@@ -5608,6 +5608,8 @@ sub Data {
'Automatischer Zeilenumbruch in Textnachrichten nach x-Zeichen.',
'Sets the number of lines that are displayed in text messages (e.g. ticket lines in the QueueZoom).' =>
'Legt die Anzahl an Zeilen fest, die von Textnachrichten angezeigt werden sollen (z. B. von Tickets in der Queue-Ansicht).',
+ 'Limits the number of options for modernized selection fields. If this limit will be exceeded, the selection field will for performance reasons be shown as non-modernized.' =>
+ 'Limitiert die Anzahl an Optionen für modernized Auswahlfelder. Wenn das Limit überschritten ist, wird das Auswahlfeld aus Performancegründen als nicht-modernized angezeigt.',
'Turns on drag and drop for the main navigation.' => 'Aktiviert Drag und Drop für die Hauptnavigation.',
'Defines the date input format used in forms (option or input fields).' =>
'Definiert das benutzte Datumseingabeformat in Formularen (Option für Eingabefelder).',
diff --git a/Kernel/Output/HTML/Layout.pm b/Kernel/Output/HTML/Layout.pm
index b9487e3cdd..5549b06ac4 100644
--- a/Kernel/Output/HTML/Layout.pm
+++ b/Kernel/Output/HTML/Layout.pm
@@ -508,6 +508,14 @@ sub Block {
Data => $Param{Data},
};
+ # For performance reasons:
+ # Do not initialize modernized input fields on selections with many entries
+ my $MaxNumberOfOptions = $Kernel::OM->Get('Kernel::Config')->Get("InputFields::ModernizedSelection::MaxNumberOfOptions");
+ $Self->AddJSData(
+ Key => 'InputFields::ModernizedSelection::MaxNumberOfOptions',
+ Value => $MaxNumberOfOptions,
+ );
+
return 1;
}
diff --git a/var/httpd/htdocs/js/Core.UI.InputFields.js b/var/httpd/htdocs/js/Core.UI.InputFields.js
index fa8fd7220d..d85dd7462e 100644
--- a/var/httpd/htdocs/js/Core.UI.InputFields.js
+++ b/var/httpd/htdocs/js/Core.UI.InputFields.js
@@ -40,7 +40,6 @@ Core.UI.InputFields = (function (TargetNS) {
ResizeEvent: 'onorientationchange' in window ? 'orientationchange' : 'resize',
ResizeTimeout: 0,
SafeMargin: 30,
- MaxNumberOfOptions: 1000,
MinQueryLength: 4,
Diacritics: {
"\u24B6":"A", "\uFF21":"A", "\u00C0":"A", "\u00C1":"A", "\u00C2":"A", "\u1EA6":"A",
@@ -1189,7 +1188,8 @@ Core.UI.InputFields = (function (TargetNS) {
// For performance reasons:
// Do not initialize modern inputfields on selects with many entries
- if ($(SelectObj).children('option').length > Config.MaxNumberOfOptions) {
+ MaxNumberOfOptions = Core.Config.Get('InputFields::ModernizedSelection::MaxNumberOfOptions');
+ if ($(SelectObj).children('option').length > MaxNumberOfOptions) {
return;
}