Skip to content

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

Merged
jasonvarga merged 4 commits into
5.xfrom
improve-copy-to-clipboard-on-ios
Aug 19, 2024
Merged

jasonvarga merged 4 commits into
5.xfrom
improve-copy-to-clipboard-on-ios

Conversation

@duncanmcclean

Copy link
Copy Markdown
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
@jasonvarga
jasonvarga deleted the improve-copy-to-clipboard-on-ios branch August 19, 2024 14:10
@jcohlmeyer

Copy link
Copy Markdown

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

@duncanmcclean

duncanmcclean commented Aug 19, 2024

Copy link
Copy Markdown
Member Author

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