Skip to content

Commit 6f2aaeb

Browse files
authored
allow passing focus options to focus trap (#134)
* allow passing focus options to focus trap * default to not scrolling when restoring focus in focus trap
1 parent e7c07da commit 6f2aaeb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/useFocusTrap.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export function useFocusTrap({
6060
) {
6161
const tabbables = getTabbableElementsOrSelf(container);
6262

63-
tabbables[0]?.focus();
63+
tabbables[0]?.focus({ preventScroll: true });
6464
}
6565
});
6666

0 commit comments

Comments
 (0)