Lexical version: 0.44
Steps To Reproduce
- Add init state to
$initialEditorState property of root extension or editorState property of InitialConfig
- Add
$addUpdateTag(SKIP_DOM_SELECTION_TAG)
- Open the editor app
Link to code example: https://codesandbox.io/p/sandbox/nodestate-in-export-html-forked-tlqrkq
⚠️ Be sure to open the iframe with the application in a separate tab
The current behavior
The application initializes and scrolls to the end of the content
The expected behavior
Scrolling does not occur if the SKIP_DOM_SELECTION_TAG tag is added during the first update, i.e. initialization
Impact of fix
It's already known that $insertNodes is the recommended method for inserting generated nodes into content, as it normalizes inline elements by wrapping them in paragraphs. This function inserts nodes by changing the selection, but adding SKIP_DOM_SELECTION_TAG doesn't change anything. If this is expected behavior and initialization isn't just a first update, it would be helpful to include in the documentation the caveat that tags don't affect behavior within initialization. It would also be helpful to include an example where content is initialized using $insertNodes and scrolling is avoided
Lexical version: 0.44
Steps To Reproduce
$initialEditorStateproperty of root extension oreditorStateproperty of InitialConfig$addUpdateTag(SKIP_DOM_SELECTION_TAG)Link to code example: https://codesandbox.io/p/sandbox/nodestate-in-export-html-forked-tlqrkq
⚠️ Be sure to open the iframe with the application in a separate tab
The current behavior
The application initializes and scrolls to the end of the content
The expected behavior
Scrolling does not occur if the
SKIP_DOM_SELECTION_TAGtag is added during the first update, i.e. initializationImpact of fix
It's already known that
$insertNodesis the recommended method for inserting generated nodes into content, as it normalizes inline elements by wrapping them in paragraphs. This function inserts nodes by changing the selection, but addingSKIP_DOM_SELECTION_TAGdoesn't change anything. If this is expected behavior and initialization isn't just a first update, it would be helpful to include in the documentation the caveat that tags don't affect behavior within initialization. It would also be helpful to include an example where content is initialized using$insertNodesand scrolling is avoided