Adding delay for dynamic

This commit is contained in:
Belen Curcio 2021-01-06 11:28:20 -03:00
parent 88aac485cf
commit e42880b088

View File

@ -37,7 +37,7 @@ export default function FocusTrap({ children, focusFirst = false }: Props) {
console.log('-----------', i) console.log('-----------', i)
match = !!tabbable(root.current).length match = !!tabbable(root.current).length
if (match) { if (match) {
const delay = i === 0 ? 0 : 100 const delay = i === 0 ? 0 : 200
setTimeout(() => { setTimeout(() => {
tabbable(root.current)[0].focus() tabbable(root.current)[0].focus()
}, delay) }, delay)