-
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
Undo / Redo unreliable with the post title #12075
Comments
Not sure it's entirely related to what's seen, but it occurs to me that since the title field is "controlled" by editor state, it should have its default Undo/Redo behavior absorbed by the application handler. Related discussion: #10650 (comment) |
Tested and confirmed that undo did not affect title changes and that redo took more clicks than expacted using WordPress 4.9.8 and Gutenberg 4.5.1 using Firefox 63.0.1 on macOS 10.13.6. (52s) |
Undo/Redo is also unreliable with List Block as well. I haven't fully had time to test it, but Undo will often times not be able to be Redo'd. |
This should already be happening, looking at the implementation: gutenberg/packages/editor/src/components/post-title/index.js Lines 70 to 88 in c8c1381
Ideally there'd be some more reliable way to intercept / override the Undo & Redo, but at least for Cmd+Z (Ctrl+Z) and Cmd+Shift+Z (Ctrl+Shift+Z), the behaviors should operate on the store's history. |
This needs specific steps to reproduce. As described in #12075 (comment) , it's expected the title edits should be reflected correctly in state for coordination by the Undo / Redo behavior, and key commands intercepted. Edit: Sorry, I'd just seen the comment at #5685 (comment) and video from #12075 (comment) . I suppose it's specific to this case where manually adding and then removing text from the title makes those earlier additions unreachable by history? It may need more testing in how this sort of thing might behave in other native contexts, as it could be an expected behavior. The specifics of the implementation are such that consecutive edits to the same field or block attribute are grouped together into a single "undo level", so for all intents and purposes those additions are not recorded because they are later removed in the same sequence of events. |
We tested this in core editor triage. Able to replicate the behavior where the title doesn't get deleted when Redoing. |
Testing with WordPress 5.7 beta 3. It seems to be working fine. |
I noticed that the last letter in the post title was not added back on redo. |
I can still reproduce the issue mentioned in #12075 (comment). The post title doesn't get deleted during redo. @paaljoachim, the post title is correctly restored for me on the redo. ScreencastCleanShot.2022-12-13.at.14.36.57.mp4 |
Great to hear George @Mamaduka ! |
Sorry, @paaljoachim. It looks like my issue confirmation comment was a little confusing :) |
Splitting this out from #5685 (comment) / #10650
#10650 improved a lot the Undo / Redo behavior with regards to RichText.
However, seems the post title is not always included in the undo / redo history. Following the steps listed on #5685 (comment) there are still cases where the post title is not restored or not removed when undoing / redoing.
Quoting @iseulde:
I haven't followed this part of the development but seems to me it's something worth investigating.
The text was updated successfully, but these errors were encountered: