Skip to content
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

If you click inside and hold then unclick outside it will hide the dropdown #9

Open
chincodev opened this issue Jul 20, 2021 · 2 comments

Comments

@chincodev
Copy link

If you click inside and hold then unclick outside it will hide the dropdown, for example Im trying to use this for a modal with a form, then when I tried to select all the text quickly, I accidentally released the click outside and the modal dissapeared, I recommend to add params to select what kind of event (mousedown, mouseup, etc)

@benoitkoenig
Copy link

I noticed the same issue. I also noticed that this behavior is inconsistent between chrome and firefox
On firefox, when clicking inside the element and releasing the click outside, onTriggered is not triggered. It is only triggered if both click's mousedown and mouseup parts happen outside the element
On chrome, if either the click's mousedown OR mouseup happen outside the element, then onTriggered will be triggered. The only way for onTriggered to not be triggered, is if the whole click is done inside the element
Of course, when both steps of the click happen inside the element, or when both steps happen outside, the expected behavior is respected

@zhaluza
Copy link
Owner

zhaluza commented Jul 30, 2021

Hi there @iAnthonyCoder @benoitkoenig , thanks for bringing this to my attention! Sounds like a very valid use case (with some interesting browser differences) that the hook should definitely handle.

Would either of you be up to making a PR that would handle this? Things are a little busy on my end at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants