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
As an aside, pressing left arrow from the bottom of the editor seems to select the center hr at first
Press backspace
Only one should be deleted, but instead two are deleted, leaving the topmost one
This also occurs with pressing the Delete key when selecting either the top or middle hr; the next two hrs are deleted.
The current behavior
Two hrs are deleted at a time in the case described above
The expected behavior
Only one hr is deleted
Impact of fix
I pointed to the playground and used hrs to illustrate the example, but we're using custom DecoratorNodes in our application (that use the same $onDelete logic as LexicalHorizontalRuleNode) and this leads to surprising behavior for users when multiple are deleted at once. In the case of just two DecoratorNodes back to back, there is a workaround by selecting just one and either pressing Delete or Backspace to force a single node at the edge to be deleted, but we wouldn't expect users to be aware of how to do that.
The text was updated successfully, but these errors were encountered:
This is mostly because of the $onDelete handlers for each of the DecoratorNodes that are added to the playground to handle NodeSelection deletion (incorrectly). They delete the selected node but return false and don't preventDefault so the nodes get deleted and then the browser also handles it which ends up deleting two nodes if it started with a NodeSelection.
If a DecoratorNode is selected and I press Backspace, if there are two or more DecoratorNodes in a row, two of them are deleted at once.
Lexical version: 0.27.0
Steps To Reproduce
This also occurs with pressing the Delete key when selecting either the top or middle hr; the next two hrs are deleted.
The current behavior
Two hrs are deleted at a time in the case described above
The expected behavior
Only one hr is deleted
Impact of fix
I pointed to the playground and used hrs to illustrate the example, but we're using custom DecoratorNodes in our application (that use the same
$onDelete
logic as LexicalHorizontalRuleNode) and this leads to surprising behavior for users when multiple are deleted at once. In the case of just two DecoratorNodes back to back, there is a workaround by selecting just one and either pressing Delete or Backspace to force a single node at the edge to be deleted, but we wouldn't expect users to be aware of how to do that.The text was updated successfully, but these errors were encountered: