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 invite link to clipboard appears to fail in Safari (desktop) #660

Closed
6 tasks
LarsKemmann opened this issue Jun 9, 2023 · 3 comments
Closed
6 tasks
Assignees
Labels
bug Something isn't working javascript Pull requests that update Javascript code priority This item is currently being prioritized.

Comments

@LarsKemmann
Copy link
Member

LarsKemmann commented Jun 9, 2023

The issue is that Safari requires clipboard writes to be done in response to a "user gesture", and we are first doing a fetch to get the invite link from the API. Since the API call should only happen when the user wants to perform this operation, the safe cross-browser solution is to:

  • make the API call and store the returned invite link in component state (useState),
  • when the invite link is in state, show a (modal) popup dialog that displays the link text to the user in a text field, and
  • provide a 'copy' button (with icon) to the right of the text field.
  • The dialog should also have a close button and be dismissable.

In addition, for browsers like Chrome where a more seamless experience is possible, we could optionally:

  • use await navigator.permissions.query({ name: 'clipboard-write', allowWithoutGesture: true }) to check if copying can be done noninteractively, and
  • if copying can be done noninteractively, do it and show a "copied!" notification.

(see https://web.dev/articles/async-clipboard)

@LarsKemmann LarsKemmann added bug Something isn't working javascript Pull requests that update Javascript code labels Jun 9, 2023
@LarsKemmann
Copy link
Member Author

Need to set up a MacinCloud environment to test this with and troubleshoot.

@LarsKemmann LarsKemmann added the priority This item is currently being prioritized. label Sep 18, 2023
@LarsKemmann LarsKemmann self-assigned this Sep 18, 2023
@LarsKemmann
Copy link
Member Author

@PabloDinella @Rabi94 Please take a look at this issue this week.

@PabloDinella
Copy link
Collaborator

Ok!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working javascript Pull requests that update Javascript code priority This item is currently being prioritized.
Projects
None yet
Development

No branches or pull requests

2 participants