Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copying code copies +/- too although they aren't highlighted. #558

Open
bcye opened this issue Sep 30, 2021 · 6 comments
Open

Copying code copies +/- too although they aren't highlighted. #558

bcye opened this issue Sep 30, 2021 · 6 comments
Labels

Comments

@bcye
Copy link

bcye commented Sep 30, 2021

I was just going through the tutorial and noticed when copying the code it copies the +/- too although they are not highlighted.

Screenshot

this copies:

choices: z.array(
+     z.object({id: z.number().optional(), text: z.string()}),
+   ),

I'm using Safari 15.0 on macOS Monterey.

@flybayer
Copy link
Member

thank you!

@JuanM04
Copy link
Contributor

JuanM04 commented Sep 30, 2021

I can't replicate in Brave. Maybe it's a problem of Safari

@bcye
Copy link
Author

bcye commented Oct 1, 2021

Weird just tried in Brave and the problem exists there too.

@bcye
Copy link
Author

bcye commented Oct 1, 2021

I did some research and it seems to be caused by this webkit issue, where -webkit-user-select: none doesn't select the text, but copies it if your selection starts before it and ends after it.

I tried it on Chrome and the problem doesn't exist there, though it does in Brave...

@bcye
Copy link
Author

bcye commented Oct 1, 2021

I found this workaround but this leads to the text being selected but not copied.

@JuanM04
Copy link
Contributor

JuanM04 commented Oct 1, 2021

I did some research and it seems to be caused by this webkit issue, where -webkit-user-select: none doesn't select the text, but copies it if your selection starts before it and ends after it.

It must be, the code generated by Tailwind contains the webkit flag:

-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;

I also tried in a Mac with Chrome and Firefox: none has this issue, only Safari

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants