Skip to content

Commit

Permalink
Prevent scroll after focusing focus capture element
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix authored and gwwar committed Jun 24, 2021
1 parent 80f8e0c commit b787346
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ export default function useTabNav() {
// doesn't refocus this block and so it allows default behaviour
// (moving focus to the next tabbable element).
noCapture.current = true;
next.current.focus();

// Focusing the focus capture element, which is located above and
// below the editor, should not scroll the page all the way up or
// down.
next.current.focus( { preventScroll: true } );
}

function onFocusOut( event ) {
Expand Down

0 comments on commit b787346

Please sign in to comment.