-
Notifications
You must be signed in to change notification settings - Fork 377
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
Menu closes prematurely when clicking trigger bottom edge #1263
Comments
@mbernwieser Interesting regression. Are you able to reproduce it in any of the examples in the docs? I ask because it would be easier to track with a reproduction |
@cibernox unfortunately not (or perhaps better so ;) ). I'll see if I find time to track the bug down in the next few days |
I ran into this issue as well. By my testing it seems to be related to the eventType changes to BasicDropdown or something. The search field being enabled also seems to prevent the issue from showing itself, and so naturally the multiple select is in worse shape due to it not having a search field at the top of the dropdown. Haven't had the time to debug if events are fired multiple times or not. Also unfortunately unable to reproduce this in the docs. Tested in Microsoft Edge Beta (Chromium). Edit: I'm using a dropdown animation as well. Might have something to do with that also, because my dropdown overlaps the trigger during the animation. |
@cibernox I think this happens because the rootEventType of the basic dropdown is "click" and the eventType for the trigger is "mousedown". If you click the very bottom edge of the trigger, the trigger will get the mousedown event and the content opens. Because we are on the very edge of the trigger and the content is open the content will actualy receive the mouseup event. Therefore the click event fires on the most specific ancestor of both elements. In our case this would propably the body element, if the content is wormholed. The dropdown registers a click event outside of itself and closes again. |
@ybaldus interesting. In the latest beta I changed the default to be click, can you install 4.0.0-beta and check if the problem is fixed for you? It requires Ember 3.13 tho. |
@cibernox With the newest beta the element which receives the mouseup event will be selected. You can probably only fix this issue if you only react on mousedown. According to mdn the following happens:
|
@cibernox In my case, I'm using power select with renderInPlace as true and it closes immediately after focus(Related issue). For design purpose, we have moved the search box over the trigger element and the power select looks like this. Due to the 'rootEventType' being changed from mousedown to click, handleRootMouseDown method is called, in which the event target will be the whole Is there any specific reason for moving away from mousedown to click other than the one mentioned here? |
@praveendinesh6 that I think was a bug that is not fixed in master: https://github.com/cibernox/ember-basic-dropdown/blob/master/addon/components/basic-dropdown-content.ts#L105 Now the root event is also configurable and EPS does. The reason is that while for selects mousedown is a better event (it's like native selects work), since ember-basic-dropdown is a generic component, I changed the default. But EPS should configure EBD to still use mousdowns, and if it doesn't then it's a bug. Are you in 3.13+? If so, maybe you can try using the beta version to see if it fixes your problem. |
@cibernox Kindly check on this when you find time. I can raise a PR to fix this. |
This is a minor thing, but the select menu appears to open and immediately close (with a single click) when clicking the very bottom edge of the trigger. See example below.
The text was updated successfully, but these errors were encountered: