You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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!)
The text was updated successfully, but these errors were encountered:
jiao1187875445
changed the title
The cursor position is incorrect when deleting non inline void nodes
[core bug] Incorrect update of 'selection' when deleting consecutive non inline 'void' nodes
Dec 15, 2023
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
2023-12-15.3.43.15.mov
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:
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
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!)
The text was updated successfully, but these errors were encountered: