-
Notifications
You must be signed in to change notification settings - Fork 209
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
[Bug]: Cannot write to clipboard in Safari from change event of sp-action-menu #3687
Comments
@rickharris our current unit testing config allows us to test this everywhere but in Safari... 😬 can you lend a hand and confirm that the selections in this demo are copied appropriately to the Clipboard in that context? I've manually confirmed in Safari 17 for macOS 13.6, but want to make sure this is doing the right thing in the context you encountered this initially. If it looks good to you, we'll get a PR together and have this in the next release. |
+ @rick ***@***.***> in case he’s not on the DL
From: Westbrook Johnson ***@***.***>
Date: Sunday, October 1, 2023 at 6:16 PM
To: adobe/spectrum-web-components ***@***.***>
Cc: Jeff Guentert ***@***.***>, Manual ***@***.***>
Subject: Re: [adobe/spectrum-web-components] [Bug]: Cannot write to clipboard in Safari from change event of sp-action-menu (Issue #3687)
EXTERNAL: Use caution when clicking on links or opening attachments.
@rickharris<https://github.com/rickharris> our current unit testing config allows us to test this everywhere but in Safari... 😬 can you lend a hand and confirm that the selections in this demo<https://direct-change--spectrum-web-components.netlify.app/storybook/?path=/story/action-menu--label-only> are copied appropriately to the Clipboard in that context? I've manually confirmed in Safari 17 for macOS 13.6, but want to make sure this is doing the right thing in the context you encountered this initially.
If it looks good to you, we'll get a PR together and have this in the next release.
—
Reply to this email directly, view it on GitHub<#3687 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BC5RWHQD3AXFMOIXCPRGO33X5IIWXANCNFSM6AAAAAA5MSQBZY>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
@Westbrook yep that demo is working how I'd hoped in Safari. Thanks! |
Code of conduct
Impacted component(s)
sp-action-menu
Expected behavior
I would like to be able to call
navigator.clipboard.writeText
from inside thechange
event ofsp-action-menu
. Safari only allows this function to be called as the result of a user interaction. Since this is the result of a user interaction it seems like this should work, and I would expect to be able to callnavigator.clipboard.writeText
successfully without an error.It's not completely surprising or unexpected that this wouldn't work, but what's interesting to me is that it does work in react-spectrum's ActionMenu
onAction
callback, so I'm curious if it could be supported here.Actual behavior
When calling
navigator.clipboard.writeText
from the change event in Safari it results in an error:Screenshots
No response
What browsers are you seeing the problem in?
Safari
How can we reproduce this issue?
NotAllowedError
and "rsCopy" is still in your clipboard when it should be "spCopy"Sample code that illustrates the problem
https://codesandbox.io/s/solitary-worker-6f26cf?file=/src/App.js
Logs taken while reproducing problem
No response
The text was updated successfully, but these errors were encountered: