Skip to content

Commit 0820640

Browse files
authored
Prevent scroll on focus for matched element (#726)
Update focus behavior to prevent scrolling when focusing an element.
1 parent b6a005d commit 0820640

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Dom/focus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ function syncFocus() {
123123
? lastFocusElement
124124
: focusableList[0];
125125

126-
matchElement?.focus();
126+
matchElement?.focus({ preventScroll: true });
127127
} else {
128128
lastFocusElement = activeElement as HTMLElement;
129129
}

0 commit comments

Comments
 (0)