-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 <[email protected]> Co-authored-by: ironprogrammer <[email protected]> Co-authored-by: richtabor <[email protected]> Co-authored-by: murshed <[email protected]> Co-authored-by: megane9988 <[email protected]> Co-authored-by: MatzeKitt <[email protected]> Co-authored-by: marekzelezny <[email protected]>
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