From f6ca1e3347da40b50522f99397499e06f5bd23a8 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Wed, 6 Jan 2021 12:20:32 -0300 Subject: [PATCH] Test: Add support for n attempts for dynamic components --- lib/focus-trap.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/focus-trap.tsx b/lib/focus-trap.tsx index a1faa6fd5..1489122ce 100644 --- a/lib/focus-trap.tsx +++ b/lib/focus-trap.tsx @@ -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(() => {