You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using ember-power-select inside the dialog, the dialog will trigger the @onclose event whenever clicking on the dropdown of the power select. The dropdown of the power-select gets rendered inside the 'ember-basic-dropdown-wormhole' div that is right under the body tag.
I tried to dig into it a bit and found out that it is caused by the headlessui-focus-trap modifier. Specifically allowOutsideClick that always calls the this.onClose(). I am rather unsure why this is the case for a dialog component as I am guessing that notification toasts for example will probably also close the dialog unless if it is rendered inside the <Dialog />'component.
FYI, if anyone else encounters this issue, you can just add the renderInPlace property and set it to true and that will solve the issue for power-select
<PowerSelect
@renderInPlace={{true}}
@options={{this.options}}
@selected={{this.selected}}
@onChange={{fn (mutthis.selected)}} as |item|>
{{item.name}}
</PowerSelect>
And you can try to refactor it and use either litsbox or menu component ;)
Yeah for simple dropdown use, absolutely! but went for power-select since I want to take advantage of the search function + multi-select without having to implement it myself :p
When using ember-power-select inside the dialog, the dialog will trigger the @onclose event whenever clicking on the dropdown of the power select. The dropdown of the power-select gets rendered inside the 'ember-basic-dropdown-wormhole' div that is right under the body tag.
I tried to dig into it a bit and found out that it is caused by the headlessui-focus-trap modifier. Specifically allowOutsideClick that always calls the this.onClose(). I am rather unsure why this is the case for a dialog component as I am guessing that notification toasts for example will probably also close the dialog unless if it is rendered inside the <Dialog />'component.
ember-headlessui/addon/components/dialog.hbs
Lines 9 to 15 in 418874b
ember-headlessui/addon/components/dialog.ts
Lines 142 to 153 in 418874b
The text was updated successfully, but these errors were encountered: