File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
DataEntry/DataEntryTable/NewEntry Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ export enum FocusTarget {
3636 Vernacular ,
3737}
3838
39+ /** Delay in ms to ensure focus change happens after browser focus management completes */
40+ const FOCUS_DELAY_MS = 10 ;
41+
3942interface NewEntryProps {
4043 analysisLang : WritingSystem ;
4144 vernacularLang : WritingSystem ;
@@ -277,7 +280,9 @@ export default function NewEntry(props: NewEntryProps): ReactElement {
277280 < NoteButton
278281 buttonId = { NewEntryId . ButtonNote }
279282 noteText = { submitting ? "" : newNote }
280- onExited = { ( ) => setTimeout ( ( ) => focus ( FocusTarget . Gloss ) , 10 ) }
283+ onExited = { ( ) =>
284+ setTimeout ( ( ) => focus ( FocusTarget . Gloss ) , FOCUS_DELAY_MS )
285+ }
281286 updateNote = { setNewNote }
282287 />
283288 ) }
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ export default function EditTextDialog(
8989
9090 return (
9191 < Dialog
92- disableRestoreFocus // Prevent focus flash on triggering element when using onExited for custom focus handling
92+ disableRestoreFocus // Disable automatic focus restoration to allow custom focus handling
9393 open = { props . open }
9494 onClose = { escapeClose }
9595 slotProps = { { transition : { onExited : props . onExited } } }
You can’t perform that action at this time.
0 commit comments