Skip to content

Commit

Permalink
Remove temp hack
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin940726 committed Feb 22, 2022
1 parent 191b2af commit 68fc140
Showing 1 changed file with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import classnames from 'classnames';
*/
import { useRef } from '@wordpress/element';
import { useSelect, useDispatch } from '@wordpress/data';
import { useEffect, useRef } from '@wordpress/element';
import {
Button,
Icon,
Expand Down Expand Up @@ -48,16 +47,6 @@ function NavigationToggle( { icon } ) {

const disableMotion = useReducedMotion();

const navigationToggleRef = useRef();

useEffect( () => {
// TODO: Remove this effect when alternative solution is merged.
// See: https://github.com/WordPress/gutenberg/pull/37314
if ( ! isNavigationOpen ) {
navigationToggleRef.current.focus();
}
}, [ isNavigationOpen ] );

const toggleNavigationPanel = () =>
setIsNavigationPanelOpened( ! isNavigationOpen );

Expand Down Expand Up @@ -104,7 +93,6 @@ function NavigationToggle( { icon } ) {
<Button
className={ classes }
label={ __( 'Toggle navigation' ) }
ref={ navigationToggleRef }
// isPressed will add unwanted styles.
aria-pressed={ isNavigationOpen }
onClick={ toggleNavigationPanel }
Expand Down

0 comments on commit 68fc140

Please sign in to comment.