diff --git a/packages/text-editor/src/components/CollaborativeAttributeBox.svelte b/packages/text-editor/src/components/CollaborativeAttributeBox.svelte index 40bf0adb25..8c01bb4eca 100644 --- a/packages/text-editor/src/components/CollaborativeAttributeBox.svelte +++ b/packages/text-editor/src/components/CollaborativeAttributeBox.svelte @@ -36,6 +36,10 @@ export let focusIndex = -1 + export function isFocused (): boolean { + return editor?.isFocused() ?? false + } + let editor: CollaborativeTextEditor $: documentId = minioDocumentId(object._id, key) diff --git a/plugins/attachment-resources/src/components/AttachmentStyleBoxCollabEditor.svelte b/plugins/attachment-resources/src/components/AttachmentStyleBoxCollabEditor.svelte index 6d56675a33..667581cca7 100644 --- a/plugins/attachment-resources/src/components/AttachmentStyleBoxCollabEditor.svelte +++ b/plugins/attachment-resources/src/components/AttachmentStyleBoxCollabEditor.svelte @@ -37,6 +37,8 @@ const client = getClient() + let editor: CollaborativeAttributeBox + let refActions: RefAction[] = [] let extraActions: RefAction[] = [] let modelRefActions: RefAction[] = [] @@ -78,6 +80,10 @@ let inputFile: HTMLInputElement + export function isFocused (): boolean { + return editor?.isFocused() ?? false + } + export function handleAttach (): void { inputFile.click() } @@ -218,6 +224,7 @@ }} >