vaul icon indicating copy to clipboard operation
vaul copied to clipboard

Text in drawer can't be selected

Open dmytro-ulianov opened this issue 9 months ago • 7 comments

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

dmytro-ulianov avatar May 07 '24 21:05 dmytro-ulianov

@dmytro-ulianov did you ever find a solution?

shrihari-prakash avatar May 21 '24 18:05 shrihari-prakash

@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.

fruityfishy avatar May 26 '24 20:05 fruityfishy

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

shrihari-prakash avatar May 27 '24 04:05 shrihari-prakash

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

fruityfishy avatar May 27 '24 12:05 fruityfishy

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.

shrihari-prakash avatar Jun 02 '24 04:06 shrihari-prakash

@shrihari-prakash, i plan to investigate this issue within the next week or two to determine how it can be resolved. and i believe the changes proposed in https://github.com/emilkowalski/vaul/pull/314 should meet our needs.

dmytro-ulianov avatar Jul 05 '24 13:07 dmytro-ulianov

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

you can fix it with !select-text in tailwind or !important with regular css

zzh8829 avatar Aug 06 '24 20:08 zzh8829

Fixed in #408

emilkowalski avatar Sep 13 '24 18:09 emilkowalski

@emilkowalski do you think it makes sense to reopen this issue since it hasn't been really resolved?

here's the discussion on twitter

dmytro-ulianov avatar Sep 30 '24 17:09 dmytro-ulianov

Still facing this with 1.0

wong2 avatar Oct 08 '24 09:10 wong2