Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Fix 'Copy Attribution' buttons on safari #279

Closed

Conversation

elharony
Copy link
Contributor

@elharony elharony commented Apr 10, 2019

As mentioned in #277 by @janeatcc that Copy Attribution buttons aren't working properly on Safari.
The problem was using the document.execCommand("copy") API and it isn't supported in Safari.

I tried to find a working solution for it, and I've attached a reference to it.

Copy link
Contributor

@brenoferreira brenoferreira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw the post on Stack Overflow and this solution seems to have some issues on some versions of Safari, like a keyboard showing, and the created element being set on focus and distracting the user. I think it's better to use something like clipboard.js which already solves these problems.

@elharony
Copy link
Contributor Author

Hi @brenoferreira ,

It's my first time to hear about clipboard.js, but I will read its docs and try to implement it. Can you give me a chance to do so? Thanks!

@kgodey
Copy link
Contributor

kgodey commented Apr 19, 2019

Marked as in progress since @elharony is working on it.

@kgodey kgodey added in progress help wanted Open to participation from the community labels Apr 19, 2019
@elharony
Copy link
Contributor Author

Hi @brenoferreira ,

Here are my the latest updates about clipboard.js:

  • We can't determine the type of copy we want. (i.e. text/html or text/plain). So, everything will be copied as Rich Text. Can't make it Plain or HTML as clipboard.js get triggered once we click on the Copy button, pointing to its target Image Attribution Paragraph, which means - We can't even hard-coded this part while using clipboard.js.
  • Other developers already mentioned this problem here
  • The clipboard.js author opened an issue about upgrading it to V3.0 since 23 Jan 2019 and it's not released yet.

It seems to be a trade-off here. What do you think? Should we stick with the current one that might have some problems with a few Safari Versions? Or use - almost - fully supported one, and lose a major feature of the page (HTML Code, Plain Text)?

Until I hear back from you, I will try to find a better alternative! 🔍

@brenoferreira
Copy link
Contributor

This is fixed in #323
Thank you for your contribution

@elharony
Copy link
Contributor Author

Thanks for your support & guidance, @brenoferreira ! 🙏

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Open to participation from the community
Development

Successfully merging this pull request may close these issues.

3 participants