Skip to content

Commit 45319b4

Browse files
Copilotimnasnainaec
andcommitted
Always disable focus restore and add small delay to focus callback
Co-authored-by: imnasnainaec <6411521+imnasnainaec@users.noreply.github.com>
1 parent 73333eb commit 45319b4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/DataEntry/DataEntryTable/NewEntry/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ export default function NewEntry(props: NewEntryProps): ReactElement {
277277
<NoteButton
278278
buttonId={NewEntryId.ButtonNote}
279279
noteText={submitting ? "" : newNote}
280-
onExited={() => focus(FocusTarget.Gloss)}
280+
onExited={() => setTimeout(() => focus(FocusTarget.Gloss), 10)}
281281
updateNote={setNewNote}
282282
/>
283283
)}

src/components/Dialogs/EditTextDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default function EditTextDialog(
8989

9090
return (
9191
<Dialog
92-
disableRestoreFocus={!!props.onExited} // Allow custom focus handling
92+
disableRestoreFocus // Prevent focus flash on triggering element when using onExited for custom focus handling
9393
open={props.open}
9494
onClose={escapeClose}
9595
slotProps={{ transition: { onExited: props.onExited } }}

0 commit comments

Comments
 (0)