mirror of
https://github.com/vercel/commerce.git
synced 2025-06-18 13:11:23 +00:00
Adding delay for dynamic
This commit is contained in:
parent
6816851630
commit
bd6bdbeaa8
@ -37,7 +37,10 @@ export default function FocusTrap({ children, focusFirst = false }: Props) {
|
||||
console.log('-----------', i)
|
||||
match = !!tabbable(root.current).length
|
||||
if (match) {
|
||||
tabbable(root.current)[0].focus()
|
||||
const delay = i === 0 ? 0 : 100
|
||||
setTimeout(() => {
|
||||
tabbable(root.current)[0].focus()
|
||||
}, delay)
|
||||
}
|
||||
i = i + 1
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user