-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dropdown doesn't render when used inside a modal #7
Comments
Hm, both (modals and power-select menus) use ember-wormhole to add their elements to DOM, but using different wormhole-containers. Probably the power-select menu is hidden, because the modal is in front. Needs to be fixed for sure... |
I did a little digging and that's exactly what it is... Adding a high z-index to the wormhole for power-select fixes the issue. |
@mwisner thanks for confirming. Will keep this issue open for a built-in fix... |
Hi @mwisner,
Hopefully this works for you. |
Does the component not support passing <Form.element
@controlType="power-select"
@options={{this.i18n.localeList}}
@optionLabelPath="text"
@renderInPlace={{true}}
/> However, this works. <Form.element
@controlType="power-select"
@options={{this.i18n.localeList}}
@optionLabelPath="text"
as |Element|
>
<Element.control @renderInPlace={{true}} />
</Form.element> I can see the code below does support passing in |
As mentioned on Discord already, the |
I can confirm that this is still an issue even after upgrade to Ember Power Select v3 and Ember Bootstrap v3.
@simonihmig Do you still consider a built-in fix? I'm tending to only document that edge case and setting |
This is not a bug and not about renderInPlace. This is because the modals z-index and the options are the same. The solution is to set a <form.element @controlType="power-select" .... as |el|>
<el.control @dropdownClass="in-modal" />
</form.element> .in-modal {
z-index: 9000;
} |
Thanks for looking into this one @ohcibi. Wondering why both are using the same
We might be able to change the one of Ember Power Select to be slightly higher as the one used by an Ember Bootstrap modal. This would be an easy fix for everyone. The value is controlled by SCSS variable Overriding it from Ember Power Select might cause issues as this would leak to other consumers of Basic Dropdown. Maybe we should propose the change upstream and see if it gets accepted. If not we can still invoke Ember Power Select with a custom class to control it's |
The z-Index issue with bootstrap is a known one for power select. Our solution involves bootstraps sass variables. We set the z-index to |
Boostrap also have a $zindex-modal variable |
Maybe it is worth then to add something like |
@ohcibi Also thought about it. But how would you do so? Currently this addon does not provide any SCSS. Should we create a small wrapper around Ember Power Select's Bootstrap theme and ask people to use that one instead? - @import 'ember-power-select/themes/bootstrap';
+ @import 'ember-bootstrap-power-select';
@import 'ember-power-select'; Or should we patch the |
I'd always provide scss for importing only needed styles. Shipping an entire bootstrap css can interfere with all sorts of stuff. I'm thinking of something like opting out from auto loading bootstrap and let the developer explicitly import only necessary styles. |
I can't follow. This addon does not ship any styles so far. |
Hello,
I'm attempting to use the power-select control type in a simple form within a modal:
I receive no errors in the console, but i'm also not seeing any options in the dropdown:
However, if I just copy and past the same form outside of the modal:
The dropdown seems to appear just fine:
The text was updated successfully, but these errors were encountered: