-
Notifications
You must be signed in to change notification settings - Fork 56
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
History stack is not empty (and broke) on a fresh start of the editor, and on new RichText block #887
Comments
The first problem reported here, where the history is not empty on a fresh start of the editor, tapping into a RichText powered block, is due to this call here: https://github.com/WordPress/gutenberg/blob/7e878b791b8a24648da3a7d5f11b9dc2a9397d8e/packages/block-editor/src/components/rich-text/index.native.js#L487 I guess we can avoid that call. |
I'm able to reproduce this, but it only seems to happen when I tap on the block containing all italicized text: "Gutenberg is available... ...plugin if needed.". It seems that once I tap that block in particular, the undo button becomes "enabled" and never goes away, even after tapping on other RichText blocks that did not previously exhibit the issue. I also noticed a related issue: when I undo the creation of a new paragraph block, the caret "tries" to go 2 blocks back instead of one. What I mean is:
If we start with:
After undo, we have:
If we start with:
After undo we have:
If the block being removed by the "undo block" is preceded by two RichText blocks, the caret will land on the first of those two blocks, but if the "undo block" is preceded by only one RichText block, and non-RichText block type precedes that, the caret seems to "stop in the right place" and ends up in the RichText block that preceded the "undo block". |
History stack is not empty on a clean start of the editor.
Problem 1:
Problem 2:
If you add a new empty block it's hard to get rid of hit by tapping on
Undo
.For the same reason of above, it seems two actions are executed in a sequence in a very small time. If you want to get rid of the block you need to tap "undo" many times, very fast. (The GIF below does show this behavior at the end).
Investigated a bit, and I think the problem is due to the
onSelectionChange
called at init and every time the user adds new text -onSelectionChange
is called right after theonChange
callback. So basically we're updating the JS side lot of times 🤔Not quite sure why we're calling
this.props.onChange( this.lastContent );
when the selection does change.cc @marecar3 @mkevins
The text was updated successfully, but these errors were encountered: