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
The original report is here, where you can see that an inline-block is incorrectly removed if it is at the end of a block and backspace is pressed at the beginning of the next one.
I was able to trace the problem back to RangeSelection.modify().
Lexical version: 0.21.0
Steps To Reproduce
Create a paragraph with an inlineDecorator at the end.
In the next empty paragraph, press backspace, or alternatively click the following plugin button:
I was trying to make the following test to make it easier to resolve the bug, but then I realized that RangeSelection.modify is using the window object and won't work in unit tests that are configured with Node, so I gave up:
test('RangeSelection.modify() at the beginning of a paragraph. The previous block ends with inlineDecorator',()=>{consteditor=createEditor({nodes: [TestDecoratorNode],});editor.update(()=>{constfirstParagraph=$createParagraphNode().append($createTextNode('hello world'),$createTestDecoratorNode(),);constsecondParagraph=$createParagraphNode();$getRoot().clear().append(firstParagraph,secondParagraph);secondParagraph.select().modify('extend',true,'character');const{anchor, focus}=$getSelection()asRangeSelection;// TODO: expects...});});
The current behavior
The final selection covers the inline decorator if you use my plugin, or removes the decorator if you press backspace.
The expected behavior
The final selection does not cover the inline decorator if you use my plugin, and it does not remove the decorator if you press backspace
The text was updated successfully, but these errors were encountered:
I can't reproduce this in the playground, for example this doc has an equation at the end which is an inline decorator. The DELETE_CHARACTER_COMMAND has workarounds for this before the selection is modified. I suspect that #7155 would fix this if you did have a case where it doesn't work, although it also leaves the workaround in that command rather than fixing the RangeSelection behavior directly.
Thanks, I just checked and this doesn't work in 0.21.0, but it does in 0.24.0, so it must have been fixed somewhere in the middle.
We'll have to upgrade!
The original report is here, where you can see that an inline-block is incorrectly removed if it is at the end of a block and backspace is pressed at the beginning of the next one.
I was able to trace the problem back to
RangeSelection.modify()
.Lexical version: 0.21.0
Steps To Reproduce
I was trying to make the following test to make it easier to resolve the bug, but then I realized that
RangeSelection.modify
is using the window object and won't work in unit tests that are configured with Node, so I gave up:The current behavior
The final selection covers the inline decorator if you use my plugin, or removes the decorator if you press backspace.
The expected behavior
The final selection does not cover the inline decorator if you use my plugin, and it does not remove the decorator if you press backspace
The text was updated successfully, but these errors were encountered: