mirror of
https://github.com/vercel/commerce.git
synced 2025-06-18 13:11:23 +00:00
Test: Add support for n attempts for dynamic components
This commit is contained in:
parent
0b16b80dbe
commit
f6ca1e3347
@ -41,12 +41,12 @@ export default function FocusTrap({ children, focusFirst = false }: Props) {
|
||||
// Attempt to focus the first el
|
||||
tabbable(root.current)[0].focus()
|
||||
}
|
||||
i = i++
|
||||
i = i + 1
|
||||
} else {
|
||||
// Clear interval after n attempts
|
||||
clearInterval(timer)
|
||||
}
|
||||
}, 1000)
|
||||
}, 100)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user