diff --git a/web/src/lib/components/elements/buttons/button.svelte b/web/src/lib/components/elements/buttons/button.svelte index a95624ec6..587641e87 100644 --- a/web/src/lib/components/elements/buttons/button.svelte +++ b/web/src/lib/components/elements/buttons/button.svelte @@ -26,7 +26,11 @@ export let fullwidth = false; export let border = false; export let title: string | undefined = ''; - export let ref: HTMLButtonElement | null = null; + export const focus = () => { + ref.focus; + }; + + let ref: HTMLButtonElement; const colorClasses: Record = { primary: diff --git a/web/src/lib/components/faces-page/merge-suggestion-modal.svelte b/web/src/lib/components/faces-page/merge-suggestion-modal.svelte index 2c4f0cab8..bb1255af1 100644 --- a/web/src/lib/components/faces-page/merge-suggestion-modal.svelte +++ b/web/src/lib/components/faces-page/merge-suggestion-modal.svelte @@ -17,8 +17,8 @@ let { isViewing: showAssetViewer } = assetViewingStore; let choosePersonToMerge = false; let changeFocus = false; - let buttonNo: HTMLButtonElement; - let buttonYes: HTMLButtonElement; + let focusButtonNo: () => void; + let focusButtonYes: () => void; const title = personMerge2.name; @@ -30,15 +30,14 @@ const handleKeyboardPress = (event: KeyboardEvent) => { if (!$showAssetViewer) { - event.stopPropagation(); switch (event.key) { case 'Tab': event.preventDefault(); if (changeFocus) { - buttonYes.focus(); + focusButtonYes(); } else { - buttonNo.focus(); + focusButtonNo(); } changeFocus = !changeFocus; @@ -144,8 +143,8 @@

They will be merged together

- - +