ghosh / Micromodal

⭕ Tiny javascript library for creating accessible modal dialogs
https://micromodal.now.sh/
MIT License
3.53k stars 228 forks source link

Form element blur on modal overlay triggers close in Chrome only #216

Open julkue opened 5 years ago

julkue commented 5 years ago

I'm showing a form within my modal. When selecting the text in e.g. a text field, and stopping the selection over the modal overlay, the modal closes in Chrome. In Firefox, however, it doesn't close.

ezgif-4-621e8e6d3fe2

It doesn't close the modal if the blur event is happening inside the modal, only if it's happening on the overlay (see example above).

ghosh commented 5 years ago

@julmot That is the expected behavior. Click outside the modal should close the modal. If that'snot the case in Chrome, its a bug and should be fixed.

Would it possible for you to show us a demo of the form on chrome?

julkue commented 5 years ago

It's not click I'm referring to, I'm referring to blur!

Just open the demo page, select text in chrome and stop selecting it while having the mouse cursor over the overlay (not the actual modal). Then you'll notice, that this will close the modal even though it's not a click. On top, it's Chrome specific.

PeterDekkers commented 4 years ago

I think this may be a duplicate of https://github.com/ghosh/Micromodal/issues/287

DimaGashko commented 4 years ago

BTW, this issue is not Chrome specific. Yes, if are focused in some field - probably chrome specific. I don't see this in Firefox and Safari. But, if you start your click inside a modal (not form element) and finish it outside - the modal closes and not only in Chrome. I tested in firefox and Safari.

Home this issue will be fixed in near future..