Description
When the React AutoFocusPlugin, (@lexical/react/LexicalAutoFocusPlugin) React OnChangePlugin (@lexical/react/LexicalOnChangePlugin) and the CodeHighlightPlugin (calling {registerCodeHighlighting} from '@lexical/code') are all enabled in the editor - then when the application first loads the document / editor and is 'AutoFocused' - an OnChange event is raised.
Pretty sure it's being caused by the code highlighter registration - but it only happens when the AutoFocus (or the call to editor.focus()) occurs (i.e. it doesn't happen when the editor is manually focused by clicking inside the editor window).
Lexical version: 0.10.0
Steps To Reproduce
- Enable all three plugins - AutoFocusPlugin, OnChangePlugin, and CodeHighlightPlugin
- Close the document / editor application and then re-open and existing document / editor - the editor will auto-focus, but it will also raise an onChange event - even though the editor state has not changed.
The current behavior
An onChange event is being raised even though there is no change to editorState
The expected behavior
There should be no onChange event when the document / editor is loaded (for example when a user is simply opening a document in the application)
Activity