-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Post Title: Fix pasting in Safari #64671
Conversation
Size Change: -9 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
Flaky tests detected in 9738545. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10484875153
|
Thank you for this fix, @Mamaduka! 🎉 In my testing in Safari, this resolves the issue. Test ReportEnvironment
Actual Results
Supplemental Artifacts |
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @Kuuuzya. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Thanks for testing, @ironprogrammer! |
Unlinked contributors: lukasbesch, Kuuuzya. Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: ironprogrammer <ironprogrammer@git.wordpress.org> Co-authored-by: richtabor <richtabor@git.wordpress.org> Co-authored-by: murshed <fahimmurshed@git.wordpress.org> Co-authored-by: megane9988 <megane9988@git.wordpress.org> Co-authored-by: MatzeKitt <kittmedia@git.wordpress.org> Co-authored-by: marekzelezny <igreenie@git.wordpress.org>
Thanks @Mamaduka for the fix! It's awesome now! Two years of struggle are finally over. |
What?
Fixes #51047.
PR fixes text pasting behavior for the post title component in Safari.
Why?
The deprecated
keypress
event, which fires beforepaste
, resets the local selection state and makes itundefined
when pasting a value. This causes unexpected behavior in browsers that still support this event.P.S. You can reproduce the same behavior on Chrome by calling
onUnselect
ononKeyDown
.How?
Remove the
onKeyPress
event handler. The event has been deprecated, and as far as I can tell, there is no actual use case for this component. It was initially introduced in #1042.Testing Instructions
Testing Instructions for Keyboard
Same.
Screenshots or screencast
CleanShot.2024-08-21.at.10.28.05.mp4