From 6c8b51bb7764a584cd0302f0f3685fe47e6bed94 Mon Sep 17 00:00:00 2001 From: Stephen Abello Date: Mon, 13 Apr 2026 11:48:38 +0200 Subject: [PATCH] =?UTF-8?q?=20N=C2=B09468=20-=20Make=20the=204px=20height?= =?UTF-8?q?=20difference=20a=20variable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/extkeywidget.js | 5 +++-- js/selectize/plugin_combodo_auto_position.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/js/extkeywidget.js b/js/extkeywidget.js index 69b4677bfb..57960698e9 100644 --- a/js/extkeywidget.js +++ b/js/extkeywidget.js @@ -120,6 +120,7 @@ function ExtKeyWidget(id, sTargetClass, sFilter, sTitle, bSelectMode, oWizHelper this.sFormAttCode = sFormAttCode; var me = this; + const iDropdownContentHeightDifference = 4; this.Init = function () { // make sure that the form is clean @@ -353,13 +354,13 @@ function ExtKeyWidget(id, sTargetClass, sFilter, sTitle, bSelectMode, oWizHelper // N°9468 Dropdown content needs to be a few pixel shorter than the dropdown itself to avoid double scrollbar if(oDropdownContentElem) { - oDropdownContentElem.css('max-height', 'calc(30vh - 4px)'); + oDropdownContentElem.css('max-height', `calc(30vh - ${iDropdownContentHeightDifference}px)`); } /* Position dropdown above input if not enough space on the bottom part of the screen Doesn't seem to work with selectize as an internal plugin "auto_position" refreshes the top position after this method is called, input set use a custom plugin to avoid fix this issue "plugin_combodo_auto_position" - This would need to take the potential 4px difference into account if this is fixed. + This would need to take the potential 4px difference (iDropdownContentHeightDifference) into account if this is fixed. */ if ((fDropdownTopY / fWindowHeight) > 0.6) { oDropdownElem.css({ diff --git a/js/selectize/plugin_combodo_auto_position.js b/js/selectize/plugin_combodo_auto_position.js index 129a3a4372..74d073046a 100644 --- a/js/selectize/plugin_combodo_auto_position.js +++ b/js/selectize/plugin_combodo_auto_position.js @@ -19,6 +19,7 @@ Selectize.define("combodo_auto_position", function (aOptions) { // Selectize instance let oSelf = this; + const iDropdownContentHeightDifference = 4; // Plugin options aOptions = $.extend({ @@ -53,7 +54,7 @@ Selectize.define("combodo_auto_position", function (aOptions) { iDropdownHeight = oSelf.$dropdown.outerHeight(); oSelf.$dropdown.css({ - top: oSelf.$control.offset().top - iDropdownHeight + 4, // Content will be shorter, so our real height too + top: oSelf.$control.offset().top - iDropdownHeight + iDropdownContentHeightDifference, // Content will be shorter, so our real height too left: oSelf.$control.offset().left, width: oSelf.$wrapper.outerWidth(), overflowY: 'auto', @@ -62,7 +63,7 @@ Selectize.define("combodo_auto_position", function (aOptions) { // N°9468 Dropdown content needs to be a few pixel shorter than the dropdown itself to avoid double scrollbar oSelf.$dropdown_content.css({ - 'max-height': `calc(${aOptions.maxDropDownHeight} - 4px)` + 'max-height': `calc(${aOptions.maxDropDownHeight} - ${iDropdownContentHeightDifference}px)` }); }