Repository navigation
Conversation
|
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 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. |
|
Size Change: +10 B (0%) Total Size: 7.75 MB 📦 View Changed
|
|
Flaky tests detected in bba1cfe. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/29953014845
|
|
Tested! confirms the fix works as expected. On trunk, pressing Cmd+Z inside the Custom HTML modal undid the block insertion and closed the whole modal. With this fix, Cmd+Z now undoes just the last text change within the field, and the modal stays open. Screen.Recording.2026-07-22.at.8.15.19.AM.mov |
|
This is not a singular issue - #80541 (comment). Why are we not updating the attribute directly? Then, the editor history should work normally. P.S. Utils like |
|
Can there be a case when a consumer wants to use editor history with normal text fields? |
|
I think this is more complex than it seems. If the input/textarea is part of a block input (maybe the search block for instance), I think you'd want the regular block editor undo/redo no? |
|
Related - #80768. |
|
Closing in favour of #80768 |
What?
Closes #80541.
See #18755 and #38731.
This PR prevents editor-level undo/redo shortcuts from running when focus is inside an input or textarea.
Why?
Native form controls should keep their browser undo/redo behavior instead of triggering post editor history, which fixes the redesigned Custom HTML modal and related input/textarea cases.
How?
The editor undo/redo shortcut callbacks now return without calling editor history or
preventDefault()when the keyboard event target is an input or textarea.Testing Instructions
Cmd+ZorCtrl+Zand confirm the focused text field undoes its own text change instead of undoing a block editor change.Cmd+ZorCtrl+Zstill undoes editor history when focus is not inside an input or textarea.Testing Instructions for Keyboard
Cmd+ZorCtrl+Z.Cmd+Shift+Z,Ctrl+Shift+Z, orCtrl+Yto confirm redo behavior where supported by the browser and OS.Screenshots or screencast
N/A.
Use of AI Tools
AI tooling used: OpenAI Codex assisted with implementation, tests, and PR preparation; changes were reviewed by the author.