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

[5.x] Display text in modal instead of alert, to improve things on iOS #10654

Merged
merged 4 commits into from
Aug 19, 2024

Conversation

duncanmcclean
Copy link
Member

This pull request improves the handling of "copy to clipboard" actions when on iOS.

iOS only allows for copying to the user's clipboard from an <input> or <textarea>.

This means that iOS browsers end up in the catch statement, with a browser alert containing the URL, which the user has to copy manually. However, some browsers like Chrome don't allow copying from alerts. 😬

To workaround this, instead of showing a browser alert, it'll open up a modal with the ability to copy from there (the copy button here will work since it's copying text from a textarea).

Closes #6378.

@jasonvarga jasonvarga merged commit eefaff1 into 5.x Aug 19, 2024
17 checks passed
@jasonvarga jasonvarga deleted the improve-copy-to-clipboard-on-ios branch August 19, 2024 14:10
@jcohlmeyer
Copy link

Why don't you just use an input to copy all the time?

@duncanmcclean
Copy link
Member Author

duncanmcclean commented Aug 19, 2024

So it's simpler for those copying on non-iOS devices, where there's no restriction on needing an <input> or <textarea> for copying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copying Password Reset Link on Mobile doesn't work
3 participants