From cfe2a645488f1ec65663c9b835629e9db395936a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20D=C4=99bi=C5=84ski?= Date: Thu, 31 Aug 2023 14:35:53 +0200 Subject: [PATCH 1/2] IBX-6451: Added verifications of what smaller itemsContainerTop or the remaining height to the bottom of the element --- .../Resources/public/js/scripts/core/custom.dropdown.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/bundle/Resources/public/js/scripts/core/custom.dropdown.js b/src/bundle/Resources/public/js/scripts/core/custom.dropdown.js index c2d7c86801..f02888421d 100644 --- a/src/bundle/Resources/public/js/scripts/core/custom.dropdown.js +++ b/src/bundle/Resources/public/js/scripts/core/custom.dropdown.js @@ -142,6 +142,13 @@ } if (this.itemsContainer.closest(SELECTOR_MODAL)) { + const heightModal = this.itemsContainer.closest('.modal-content').getBoundingClientRect().height; + const leftToBottom = heightModal - itemsContainerTop; + + if (leftToBottom < itemsContainerTop) { + return leftToBottom; + } + return itemsContainerTop - DROPDOWN_MARGIN; } From bfeaa76182154545aed135568531e8c549d6e641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20D=C4=99bi=C5=84ski?= Date: Fri, 1 Sep 2023 12:37:37 +0200 Subject: [PATCH 2/2] Calculating the size of the dropdown element has been changed --- .../Resources/public/js/scripts/core/custom.dropdown.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/bundle/Resources/public/js/scripts/core/custom.dropdown.js b/src/bundle/Resources/public/js/scripts/core/custom.dropdown.js index f02888421d..5b96d12971 100644 --- a/src/bundle/Resources/public/js/scripts/core/custom.dropdown.js +++ b/src/bundle/Resources/public/js/scripts/core/custom.dropdown.js @@ -142,14 +142,9 @@ } if (this.itemsContainer.closest(SELECTOR_MODAL)) { - const heightModal = this.itemsContainer.closest('.modal-content').getBoundingClientRect().height; - const leftToBottom = heightModal - itemsContainerTop; + const modalHeight = this.itemsContainer.closest('.modal-content').getBoundingClientRect().height; - if (leftToBottom < itemsContainerTop) { - return leftToBottom; - } - - return itemsContainerTop - DROPDOWN_MARGIN; + return modalHeight - itemsContainerTop; } return documentElementHeight - itemsContainerTop - DROPDOWN_MARGIN;