Skip to content

Commit 289633b

Browse files
committed
fix: enhance focus handling by adding smooth scroll to content area
1 parent 375c058 commit 289633b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/core/event/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,11 @@ export function Events(Base) {
414414
dom.find('#main');
415415

416416
// Move focus to content area
417-
focusEl?.focus(settings);
417+
if (focusEl) {
418+
focusEl.focus(settings);
419+
420+
focusEl.scrollIntoView({ behavior: 'smooth', block: 'start' });
421+
}
418422

419423
return focusEl;
420424
}

0 commit comments

Comments
 (0)