File tree Expand file tree Collapse file tree 2 files changed +16
-13
lines changed
Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -90,16 +90,18 @@ export default function FlowLogsModal({
9090 }
9191 } , [ ] ) ;
9292
93+ const handleOpenAutoFocus = useCallback ( ( e : Event ) => {
94+ e . preventDefault ( ) ;
95+ ( document . querySelector ( ".ag-body-viewport" ) as HTMLElement ) ?. focus ( ) ;
96+ } , [ ] ) ;
97+
9398 return (
9499 < >
95100 < BaseModal
96101 open = { open }
97102 setOpen = { setOpen }
98103 size = "x-large"
99- onOpenAutoFocus = { ( e ) => {
100- e . preventDefault ( ) ;
101- ( document . querySelector ( ".ag-body-viewport" ) as HTMLElement ) ?. focus ( ) ;
102- } }
104+ onOpenAutoFocus = { handleOpenAutoFocus }
103105 >
104106 < BaseModal . Trigger asChild > { children } </ BaseModal . Trigger >
105107 < BaseModal . Header description = "Inspect component executions." >
Original file line number Diff line number Diff line change 11import { truncate } from "lodash" ;
2- import { useState } from "react" ;
2+ import { useCallback , useState } from "react" ;
33import ForwardedIconComponent from "@/components/common/genericIconComponent" ;
44import Loading from "@/components/ui/loading" ;
55import ConfirmationModal from "../confirmationModal" ;
@@ -20,6 +20,14 @@ export function SaveChangesModal({
2020 autoSave : boolean ;
2121} ) : JSX . Element {
2222 const [ saving , setSaving ] = useState ( false ) ;
23+
24+ const handleOpenAutoFocus = useCallback ( ( e : Event ) => {
25+ e . preventDefault ( ) ;
26+ (
27+ document . querySelector ( '[data-testid="replace-button"]' ) as HTMLElement
28+ ) ?. focus ( ) ;
29+ } , [ ] ) ;
30+
2331 return (
2432 < ConfirmationModal
2533 open = { true }
@@ -42,14 +50,7 @@ export function SaveChangesModal({
4250 onCancel = { onProceed }
4351 loading = { autoSave ? true : saving }
4452 size = "x-small"
45- onOpenAutoFocus = { ( e ) => {
46- e . preventDefault ( ) ;
47- (
48- document . querySelector (
49- '[data-testid="replace-button"]' ,
50- ) as HTMLElement
51- ) ?. focus ( ) ;
52- } }
53+ onOpenAutoFocus = { handleOpenAutoFocus }
5354 >
5455 < ConfirmationModal . Content >
5556 { autoSave ? (
You can’t perform that action at this time.
0 commit comments