diff --git a/lib/focus-trap.tsx b/lib/focus-trap.tsx index c57822527..980eb23ad 100644 --- a/lib/focus-trap.tsx +++ b/lib/focus-trap.tsx @@ -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 }