emilkowalski / vaul

An unstyled drawer component for React.
https://vaul.emilkowal.ski
MIT License
5.26k stars 169 forks source link

Text in drawer can't be selected #346

Open dmytro-ulianov opened 1 month ago

dmytro-ulianov commented 1 month ago

There was already a similar issue before: https://github.com/emilkowalski/vaul/issues/295.

It looks like the #182 (drawer handle component) discards the changes introduced in #314 (block swipe if in wrong direction).

My guess is that this change from #314 was reverted in drawer handle PR and that's the reason why text selection is not working image

shrihari-prakash commented 1 month ago

@dmytro-ulianov did you ever find a solution?

fruityfishy commented 1 month ago

@shrihari-prakash, following worked for me:

<Drawer.Content className="select-text">
                This is your drawer content
</Drawer.Content>

Basically overriding the user-select with user-select: text; PS: I am using tailwind user-select but you should be able to use user-select: text; for the drawer content's style.

shrihari-prakash commented 1 month ago

@fruityfishy , unfortunately, this also does not seem to work for me :(. Does this solution work for you on mobile phones?

fruityfishy commented 1 month ago

@shrihari-prakash, ah that's unfortunate. I haven't checked on mobile but I can confirm it works on web.

shrihari-prakash commented 4 weeks ago

Hello @emilkowalski , would there be any plan to fix this? Or would you possibly know any workarounds that we could try to solve this issue? Would appreciate any clue on how to resolve this.