From 999aaa35a79ae7c586a91de1f6c1f7b3c8092bd2 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Thu, 3 Aug 2023 20:00:07 +0200 Subject: [PATCH] FIX: A select-kit+modal regression (#22961) Regressed in https://github.com/discourse/discourse/pull/22642 `inModal` var is `.modal-body` itself now, so the changing the modal height failed. --- .../javascripts/select-kit/addon/components/select-kit.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 e1fc205f835..e149bccc25e 100644 --- a/app/assets/javascripts/select-kit/addon/components/select-kit.js +++ b/app/assets/javascripts/select-kit/addon/components/select-kit.js @@ -988,10 +988,9 @@ export default Component.extend( enabled: !!(inModal && this.site.mobileView), phase: "afterWrite", fn: ({ state }) => { - const modalBody = inModal.querySelector(".modal-body"); - modalBody.style = ""; - modalBody.style.height = - modalBody.clientHeight + state.rects.popper.height + "px"; + inModal.style = ""; + inModal.style.height = + inModal.clientHeight + state.rects.popper.height + "px"; }, }, ],