base-ui icon indicating copy to clipboard operation
base-ui copied to clipboard

[Dialog][Popover] Prevent outside touch interactions

Open vladmoroz opened this issue 1 year ago • 1 comments

To explore:

  • Always prevent outside touch interactions, even with modal={false}
    • Truly non-modal popups are always problematic on mobile devices because there are no hovers to indicate whether outside interactions will activate the interactive elements beneath
    • There tends to be much less "free" space for a safe click out on mobile
  • When dismissing popups with outside interactions, do we want to close the component using touchstart or touchend?
    • All native iOS popups close on touch start
    • Counter point: closing on touchstart might make zooming/panning harder

vladmoroz avatar Sep 27 '24 09:09 vladmoroz

With backdrops, we can't use touchstart (actually, pointerdown) since the event falls through the backdrop and triggers events on elements where the touch occurred, even if it was modal. That's the same issue mentioned for point number 1. The mousedown event (currently used) works lazily on touch, but eagerly with mouse.

atomiks avatar Sep 29 '24 22:09 atomiks