-
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
Removing a block(s) with keyboard selection + backspace/delete does not reflect on preview or publish #42213
Comments
Sounds like it's related to this comment by @youknowriad #38892 (comment) but for rich text blocks only. cc @ellatrix |
I think the problem might be that when selecting two blocks in this way, the editor doesn't seem to consider it a multi-selection. This is how the editor is supposed to look when two blocks are selected using the mouse (notice the block toolbar shows grouping buttons because the editor considers this a multi-block selection): This is how it looks when following the reproduction steps (the grouping buttons aren't shown): I think that because the editor doesn't consider this a multi-block selection, it doesn't properly delete the blocks when backspace or delete is pressed. From what I can tell it's this bit of code that isn't working, it doesn't set the end selection when the second block is selected. I'm not sure what the right fix would be, it seems difficult to determine when the second block is selected versus when the whole of the first block is selected: gutenberg/packages/rich-text/src/component/use-input-and-selection.js Lines 150 to 173 in dd8d577
Hopefully @ellatrix has an idea 😄 |
Also notice when selecting using keyboard, it doesn't get reflected on the list view |
I wasn't able to replicate this on GB trunk or 6.1 Beta - I also tried just using the down arrow as @alanjacobmathew suggested but got the same result: keyboard-selection.mp4 |
Indeed, this seems to only affect 6.0.x. |
Same here. 🎉 Thanks for checking. I'll close the issue. |
Description
The issue can be seen when a new post is created (with or without the Gutenberg plugin installed), and you try to remove some lines of text or paragraph by the method of selecting them (keyboard selection) and pressing backspace/delete. Those lines/para won't be deleted and you can see that in preview, and also when the post is published.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: