From e214fc38ed14143e702a9e3f2d2b7a2a0ffbc572 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Mon, 17 Jul 2023 17:39:01 +0200 Subject: [PATCH] FIX: in modal should check for body (#22642) To decide to use flip behavior select-kit will check if it's located inside a modal as a modal will scroll if overflown, however, when locating the select-kit element in the footer or header this is not the case. This commit will deactivate `flip` modifier only when used inside modal body. --- .../javascripts/select-kit/addon/components/select-kit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/select-kit/addon/components/select-kit.js b/app/assets/javascripts/select-kit/addon/components/select-kit.js index 8a9ed97ee68..b3aa9acefb7 100644 --- a/app/assets/javascripts/select-kit/addon/components/select-kit.js +++ b/app/assets/javascripts/select-kit/addon/components/select-kit.js @@ -876,7 +876,7 @@ export default Component.extend( this.selectKit.onOpen(event); if (!this.popper) { - const inModal = this.element.closest("#discourse-modal"); + const inModal = this.element.closest("#discourse-modal .modal-body"); const anchor = document.querySelector( `#${this.selectKit.uniqueID}-header` );