diff --git a/packages/svelte-lexical/src/components/richtext/RichTextComposer.svelte b/packages/svelte-lexical/src/components/richtext/RichTextComposer.svelte index 3cb4d39..1fe07d9 100644 --- a/packages/svelte-lexical/src/components/richtext/RichTextComposer.svelte +++ b/packages/svelte-lexical/src/components/richtext/RichTextComposer.svelte @@ -41,7 +41,7 @@ }; export function getEditor(): LexicalEditor { - return composer.$$.context.get('editor'); + return composer.getEditor(); } </script> diff --git a/packages/svelte-lexical/src/core/Composer.svelte b/packages/svelte-lexical/src/core/Composer.svelte index 8754c68..dd280e7 100644 --- a/packages/svelte-lexical/src/core/Composer.svelte +++ b/packages/svelte-lexical/src/core/Composer.svelte @@ -72,6 +72,10 @@ const isEditable = initialConfig.editable; editor.setEditable(isEditable !== undefined ? isEditable : true); }); + + export function getEditor() { + return editor; + } </script> <slot />