[core bug] Incorrect update of 'selection' when deleting consecutive non inline 'void' nodes
Description When there are multiple consecutive non inline void nodes in the article, such as indexes 5, 6, 7, and 8. When the cursor selects 6, the path is [6,0], and then the 'editor. deleteBackward()' method is triggered to delete it. At this time, the selection path is still [6,0], which will cause continuous deletion, and each deletion will be backward deletion. The correct way would be to delete the void node of path [6,0] and change the selection path to [5,0].
Use your "image"[ https://www.slatejs.org/examples/images ]The example can reproduce this bug by first creating multiple consecutive void image nodes of the same level, and then selecting one for continuous deletion. It will be found that each time it is deleted backwards.
Recording
https://github.com/ianstormtaylor/slate/assets/25817136/bb5fed5a-2c0f-4d01-a353-8eb5bcd11afc
Sandbox A link to a sandbox where the error can be reproduced. (You can start from the base sandbox here: https://codesandbox.io/s/slate-reproductions-c7gyg or refer to the Slate website too.)
Steps To reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expectation For continuous non inline void nodes, after deleting one of them, the selection should move forward instead of staying in its original position
Environment
- Slate Version: [e.g. 0.101.1]
- Operating System: [e.g. mac os]
- Browser: [e.g. Chrome, Safari, firfox]
Context Add any other context about the problem here. (The fastest way to have an issue fixed is to create a pull request with working, tested code and we'll help merge it. Slate is solving a pretty complex problem, and we can't do it without active contributors, so thank you so much for your help!)