Lexical: Improved nested details interaction

- Set to open by default on insert.
- Updated selection handling not to always fully cascade to lowest
  editable child on selection, so parents can be reliably selected.
- Updated mouse handling to treat details panes like the root element,
  inserting within-details where relevant.
This commit is contained in:
Dan Brown
2025-08-26 14:41:42 +01:00
parent ee994fa2b7
commit 849bc4d6c3
8 changed files with 96 additions and 23 deletions

View File

@@ -1,4 +1,4 @@
import {createEditor, LexicalEditor} from 'lexical';
import {createEditor} from 'lexical';
import {createEmptyHistoryState, registerHistory} from '@lexical/history';
import {registerRichText} from '@lexical/rich-text';
import {mergeRegister} from '@lexical/utils';
@@ -89,6 +89,9 @@ export function createPageEditorInstance(container: HTMLElement, htmlContent: st
window.debugEditorState = () => {
return editor.getEditorState().toJSON();
};
context.manager.onSelectionChange((selection) => {
console.log(selection, context.editor.getEditorState());
});
registerCommonNodeMutationListeners(context);