Skip to content

Commit

Permalink
refactor: Composer.getEditor() for easy access to editor
Browse files Browse the repository at this point in the history
  • Loading branch information
umaranis committed Jul 6, 2023
1 parent bec69ba commit 299b6e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
};
export function getEditor(): LexicalEditor {
return composer.$$.context.get('editor');
return composer.getEditor();
}
</script>

Expand Down
4 changes: 4 additions & 0 deletions packages/svelte-lexical/src/core/Composer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
const isEditable = initialConfig.editable;
editor.setEditable(isEditable !== undefined ? isEditable : true);
});
export function getEditor() {
return editor;
}
</script>

<slot />

0 comments on commit 299b6e0

Please sign in to comment.