quasar icon indicating copy to clipboard operation
quasar copied to clipboard

Modal closes unexpectedly

Open spectrolite opened this issue 9 years ago • 3 comments

Software version

Quasar: 0.14-beta OS: MacOS Sierra Browsers: Chrome latest

What did you get as the error?

QModal gets closed unexpectedly.

What were you expecting?

QModal to stay open.

What steps did you take, to get the error?

  1. Open a QModal containing draggable UI elements (i noticed specifically with a q-slider and a google map, but any other kind of draggable UI element would create this problem), in a setup that allows for some of the underlying page to be visible around it.
  2. Use a draggable element and end your movement out of the modal: it happens very easily unintentionally, both on touch- or mouse-based platforms. This also happens whether or not you use draggable elements, just click anywhere in the modal, drag until out, then release. It's just that draggable elements tend to push the user into this "mistake".

This should not be a "mistake" users have to avoid, nor do I want to disallow clicking outside the modal to dismiss it. I just don't want it to happen unintentionally. The click should start (mouseDown) AND end (mouseUp) outside of the modal for it to close. At the moment it seems to be reacting only to the click/touch UP, and this has bad UX side-effects.

spectrolite avatar Jul 28 '17 09:07 spectrolite

Further investigation suggests that the close behaviour is triggered by "mouseDown outside of modal" OR "mouseUp outside of modal", but it takes effect (i.e. actually closes the Modal) only AFTER mouseUp (and this last part makes total sense in terms of UX). In practical terms:

  • mouseDown anywhere non-clickable in the viewport* , mouseUP outside the modal => close
  • mouseDown outside the modal, mouseUp anywhere non-clickable in the viewport* => close

'*' like in the modal... or not, but not outside the browser window, and not on a btn or any element that captures clicks.

the above is the manifestation of this logic:

IF mouseDown is not in modal boundaries OR mouseUp is not in modal boundaries
THEN close after mouseUp

imho the correct behavior would be:

  • mouseDown outside the modal, mouseUp outside the modal => close

Or in logic terms:

IF mouseDown is not in modal boundaries AND mouseUp is not in modal boundaries
THEN close after mouseUp

spectrolite avatar Jul 28 '17 10:07 spectrolite

I haven't tested extensively on touch devices but I can't imagine why this fix would not affect all platforms equally. I was about to say that it's less of an issue with touch devices, since most modals tend to be fullscreen there... but that's forgetting about large tablets and the increasingly less rare touch enabled desktops/laptops, as well as public access devices, which often have large touch screens.

spectrolite avatar Jul 28 '17 10:07 spectrolite

Will fix it. Thanks for reporting.

rstoenescu avatar Aug 03 '17 08:08 rstoenescu