-
Notifications
You must be signed in to change notification settings - Fork 137
fix: copyClipboard #2432
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
base: main
Are you sure you want to change the base?
fix: copyClipboard #2432
Conversation
|
Preview is ready. |
| if (typeof navigator !== 'undefined' && navigator.clipboard?.writeText) { | ||
| try { | ||
| return navigator.clipboard.writeText(text); | ||
| navigator.clipboard.writeText(text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How this solves the problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
writeText returns a Promise, so if it fails normally (security issue) we'll never get into the catch block and run fallback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this should we async/await function to work correctly indeed
|
Visual Tests Report is ready. |
f65d792 to
ed113eb
Compare
#2421