UBERF-4757 Expose isFocused function in collaborative editors (#4275)

Signed-off-by: Alexander Onnikov <alexander.onnikov@xored.com>
This commit is contained in:
Alexander Onnikov 2023-12-26 18:09:20 +07:00 committed by GitHub
parent 843ddfeb99
commit 564ad122e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -36,6 +36,10 @@
export let focusIndex = -1
export function isFocused (): boolean {
return editor?.isFocused() ?? false
}
let editor: CollaborativeTextEditor
$: documentId = minioDocumentId(object._id, key)

View File

@ -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 @@
}}
>
<CollaborativeAttributeBox
bind:this={editor}
{object}
{key}
{focusIndex}