From 8fbdce36a490cd11262b3f23f3f143b4d8dbeb4f Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Tue, 16 Apr 2024 13:58:06 +0200 Subject: [PATCH] FIX: prevents open to happen too early (#26649) In discourse-assign the assign menu in the modal is using this `expandedOnInsert` option and was sometimes not opening correctly resulting in a broken state until you click two times on it. This should prevent this issue. --- .../javascripts/select-kit/addon/components/select-kit.js | 4 +++- 1 file changed, 3 insertions(+), 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 42acb2ab4f9..d75b736f813 100644 --- a/app/assets/javascripts/select-kit/addon/components/select-kit.js +++ b/app/assets/javascripts/select-kit/addon/components/select-kit.js @@ -198,7 +198,9 @@ export default Component.extend( this.appEvents.on("keyboard-visibility-change", this, this._updatePopper); if (this.selectKit.options.expandedOnInsert) { - this._open(); + next(() => { + this._open(); + }); } },