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
I have copied the column layout and image nodes from the playground in my project and I implemented a backspace handler for the column layout, to be able to remove it. My solution is to append all the children of the layout item into his ancestor and then remove it.
Here is the backspace handler i wrote:
The editor stop working and i get those errors Expected node root to have a parent, updateEditor: selection has been lost because the previously selected nodes have been removed and selection wasn't moved to another node. Ensure selection changes after removing/replacing a selected node
When i disable the remove of the layout item and just keep the append of the children i notice the different behavior of the ListNode compared to the others:
Append on a quote node:
Enregistrement.de.l.ecran.2024-11-05.101942.mp4
The children are moved into the node like i expect them to be.
The selection follows them.
Append on a list node:
Enregistrement.de.l.ecran.2024-11-05.102025.mp4
The children are duplicated into the node and the image is lost. The selection stays in the original children.
I believe this is what triggers my bug as when i try to remove the layout item the children are still in and the selection is lost afterwards.
Lexical version: 0.19.0
The text was updated successfully, but these errors were encountered:
where it creates a new textNode and only paste the text content inside it ignoring the image that is kept as a decorator.
I can try to resolve this and make a pull request but I don't have enough context and there might be a reason for this special behaviour on ListNode that i don't know of.
I have copied the column layout and image nodes from the playground in my project and I implemented a backspace handler for the column layout, to be able to remove it. My solution is to append all the children of the layout item into his ancestor and then remove it.
Here is the backspace handler i wrote:
It works fine on every node:
Enregistrement.de.l.ecran.2024-11-05.085945.mp4
But it fails when the ancestor is a ListNode.
The editor stop working and i get those errors
Expected node root to have a parent
,updateEditor: selection has been lost because the previously selected nodes have been removed and selection wasn't moved to another node. Ensure selection changes after removing/replacing a selected node
When i disable the remove of the layout item and just keep the append of the children i notice the different behavior of the ListNode compared to the others:
Append on a quote node:
Enregistrement.de.l.ecran.2024-11-05.101942.mp4
The children are moved into the node like i expect them to be.
The selection follows them.
Append on a list node:
Enregistrement.de.l.ecran.2024-11-05.102025.mp4
The children are duplicated into the node and the image is lost. The selection stays in the original children.
I believe this is what triggers my bug as when i try to remove the layout item the children are still in and the selection is lost afterwards.
Lexical version: 0.19.0
The text was updated successfully, but these errors were encountered: