Skip to content

Commit

Permalink
chore: make scroll consistent in long popover vrts
Browse files Browse the repository at this point in the history
  • Loading branch information
TarunAdobe committed Nov 26, 2024
1 parent b8ed244 commit 03de448
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/overlay/stories/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ class IsOverlayOpen extends HTMLElement {
if (selectedItem) {
selectedItem.focus();
selectedItem.focused = true;

// scroll the selected item into view with block start alignment to ensure consistent behavior in VRTs
await nextFrame();
selectedItem.scrollIntoView({ block: 'start' });
await nextFrame();
}
};

Expand Down

0 comments on commit 03de448

Please sign in to comment.