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

Copy to clipboard fails in safari #18154

Closed
3 tasks done
nytai opened this issue Jan 24, 2022 · 5 comments
Closed
3 tasks done

Copy to clipboard fails in safari #18154

nytai opened this issue Jan 24, 2022 · 5 comments
Labels
#bug Bug report inactive Inactive for >= 30 days

Comments

@nytai
Copy link
Member

nytai commented Jan 24, 2022

For some actions the copy to clipboard action fails in safari. It appears that safari has strict security measures in place for the copy api. The copy api cannot be called from an api response and must be called from a user interaction (a DOM callback event). This is causing actions in superset that follow the pattern of call some api (usually to save some value) then copy the api response to clipboard to fail. The error message that's thrown suggest using cmd/ctrl + c to copy the value, however the value is not stored anywhere the user can highlight and copy.

How to reproduce the bug

  1. Open Safari browser
  2. Go to SQL Lab > SQL Editor
  3. Click "Copy Link" button
  4. See error

Expected results

Results are copied to clipboard or an acceptable workaround is presented to the user, such as displaying the value that should have been copied so the user can highly and cmd/ctrl + c the value.

Actual results

Copy to clipboard fails, an toast is thrown "Sorry, your browser does not support copying. Use Ctrl / Cmd + C!", and the user is unable to copy the value to clipboard

Screenshots

Screen Shot 2022-01-24 at 11 54 04 AM

Environment

(please complete the following information):

  • browser type and version: Safari (latest)
  • superset version: 1.4.0
  • python version: 3.8.12
  • node.js version: N/A (using prebuilt assets)
  • any feature flags active: N/A

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

@nytai nytai added the #bug Bug report label Jan 24, 2022
@nytai
Copy link
Member Author

nytai commented Jan 24, 2022

It seems a way around this is store the returned value in the DOM somehow and add a copy to clipboard button which should work. If that doesn't work, at the very least the value is stored somewhere the user can highlight and cmd/ctrl + c manually. This fallback could be called when the copyTextToClipboard action fails (the promise rejects)

@nytai
Copy link
Member Author

nytai commented Jan 24, 2022

I suppose an even easier fix (though a little annoying) would be to add the copy text to the failure toast, then the user could just copy the value manually from there.

@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

@stale stale bot added the inactive Inactive for >= 30 days label Apr 17, 2022
@nytai
Copy link
Member Author

nytai commented Jun 6, 2022

should be fixed by #20058

@nytai nytai closed this as completed Jun 6, 2022
@isabellalacerda
Copy link

Copying doesn't work in any browser for me. How can i fix this?
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report inactive Inactive for >= 30 days
Projects
None yet
Development

No branches or pull requests

2 participants