huntabyte / vaul-svelte

An unstyled drawer component for Svelte.
https://vaul-svelte.com
MIT License
419 stars 17 forks source link

Mouse selection doesn't work inside Vaul #30

Closed mateuszlewko closed 7 months ago

mateuszlewko commented 7 months ago

Describe the bug

Hi! Thanks for the awesome port.

Mouse selection doesn't seem to work inside Vaul content component. Is there any way to make it work? Potentially by disabling close gesture (or making it work only at the top of the drawer)?

Reproduction

Try to select any text in demo Vaul: https://www.vaul-svelte.com/examples.

Logs

No response

System Info

System:
    OS: macOS 14.2.1
    CPU: (8) arm64 Apple M1 Pro
  Browsers:
    Safari: 17.2.1

Severity

annoyance

huntabyte commented 7 months ago

Does it work with a phone? This is supposed to be used with mobile devices as an alternative to dialogs, so the functionality won't be the exact same for desktop devices.

mateuszlewko commented 7 months ago

I haven't checked on a phone, but actually simply adding user-select: text to div inside Drawer.Content resolved the issue. Of course it makes only sense to select text horizontally, as moving it vertically will move the drawer down.

This is supposed to be used with mobile devices as an alternative to dialogs

I'd say the drawer is very cool even on desktop :)

rbozan commented 3 months ago

@mateuszlewko When I add user-select: text, I can select the text but the modal would scroll when I move my mouse.