Skip to content

Commit

Permalink
Prevent scroll on focus.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstine committed Jan 31, 2023
1 parent b9821b0 commit 7945440
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default function ListViewSidebar() {
// Either focus the list view or the list view tab. Must have a fallback because the list view does not render when there are no blocks. If list view is available, need to skip close, list view, and outline tabs. If list view is not available, need to skip close button.
const listViewFocusLocation =
sidebarTabbables[ 3 ] || sidebarTabbables[ 1 ];
listViewFocusLocation.focus();
listViewFocusLocation.focus( { preventScroll: true } );
// Outline tab is selected.
} else {
// Find the 3rd tabbable based on the attached sidebar ref. This is to skip over the close button, list view tab button, and landing on outline tab button since there is nothing else to focus after.
Expand Down

0 comments on commit 7945440

Please sign in to comment.