Skip to content

Commit

Permalink
Do not set focus on the Close revisions button in the canvas.
Browse files Browse the repository at this point in the history
  • Loading branch information
afercia committed Dec 12, 2024
1 parent 45eb439 commit 3e47bf2
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ESCAPE } from '@wordpress/keycodes';
import { __ } from '@wordpress/i18n';
import { useDispatch, useSelect } from '@wordpress/data';
import { closeSmall } from '@wordpress/icons';
import { useFocusOnMount, useFocusReturn } from '@wordpress/compose';
import { useFocusReturn } from '@wordpress/compose';
import { store as preferencesStore } from '@wordpress/preferences';
import {
store as editorStore,
Expand Down Expand Up @@ -74,7 +74,6 @@ function EditorCanvasContainer( {
);
const { setIsListViewOpened } = useDispatch( editorStore );

const focusOnMountRef = useFocusOnMount( 'firstElement' );
const sectionFocusReturnRef = useFocusReturn();

function onCloseContainer() {
Expand Down Expand Up @@ -119,7 +118,6 @@ function EditorCanvasContainer( {
{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }
<section
className="edit-site-editor-canvas-container__section"
ref={ shouldShowCloseButton ? focusOnMountRef : null }
onKeyDown={ closeOnEscape }
aria-label={ title }
>
Expand Down

0 comments on commit 3e47bf2

Please sign in to comment.