add onSelectionUpdate callback to edra editor
This commit is contained in:
parent
0339a3f832
commit
180c26a244
2 changed files with 4 additions and 1 deletions
|
|
@ -43,6 +43,7 @@
|
|||
editable = true,
|
||||
content,
|
||||
onUpdate,
|
||||
onSelectionUpdate,
|
||||
autofocus = false,
|
||||
class: className
|
||||
}: EdraEditorProps = $props();
|
||||
|
|
@ -70,7 +71,8 @@
|
|||
slashcommand(SlashCommandList)
|
||||
],
|
||||
{
|
||||
onUpdate,
|
||||
...(onUpdate && { onUpdate }),
|
||||
...(onSelectionUpdate && { onSelectionUpdate }),
|
||||
onTransaction(props) {
|
||||
// Only update if editor instance actually changed
|
||||
// The old pattern (editor = undefined; editor = props.editor) was a Svelte 4
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ export interface EdraEditorProps {
|
|||
editor?: Editor;
|
||||
autofocus?: boolean;
|
||||
onUpdate?: () => void;
|
||||
onSelectionUpdate?: () => void;
|
||||
class?: string;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue