diff --git a/packages/e2e-tests/specs/editor-modes.test.js b/packages/e2e-tests/specs/editor-modes.test.js index 155b2c207013b..bc055b5ff9960 100644 --- a/packages/e2e-tests/specs/editor-modes.test.js +++ b/packages/e2e-tests/specs/editor-modes.test.js @@ -98,8 +98,11 @@ describe( 'Editing modes (visual/HTML)', () => { let blockInspectorTab = await page.$( '.edit-post-sidebar__panel-tab.is-active[data-label="Block"]' ); expect( blockInspectorTab ).not.toBeNull(); - // Switch to Code Editor + // Switch to Code Editor and hide More Menu await switchEditorModeTo( 'Code' ); + await page.click( + '.edit-post-more-menu [aria-label="Hide more tools & options"]' + ); // The Block inspector should not be active anymore blockInspectorTab = await page.$( '.edit-post-sidebar__panel-tab.is-active[data-label="Block"]' ); diff --git a/packages/edit-post/src/components/header/feature-toggle/index.js b/packages/edit-post/src/components/header/feature-toggle/index.js index b855ca046c386..9dc6e3a5a9302 100644 --- a/packages/edit-post/src/components/header/feature-toggle/index.js +++ b/packages/edit-post/src/components/header/feature-toggle/index.js @@ -40,7 +40,6 @@ export default compose( [ withDispatch( ( dispatch, ownProps ) => ( { onToggle() { dispatch( 'core/edit-post' ).toggleFeature( ownProps.feature ); - ownProps.onToggle(); }, } ) ), withSpokenMessages, diff --git a/packages/edit-post/src/components/header/mode-switcher/index.js b/packages/edit-post/src/components/header/mode-switcher/index.js index 52ca0b78cfc94..48537170dfa13 100644 --- a/packages/edit-post/src/components/header/mode-switcher/index.js +++ b/packages/edit-post/src/components/header/mode-switcher/index.js @@ -53,10 +53,9 @@ export default compose( [ mode: select( 'core/edit-post' ).getEditorMode(), } ) ), ifCondition( ( { isRichEditingEnabled } ) => isRichEditingEnabled ), - withDispatch( ( dispatch, ownProps ) => ( { + withDispatch( ( dispatch ) => ( { onSwitch( mode ) { dispatch( 'core/edit-post' ).switchEditorMode( mode ); - ownProps.onSelect( mode ); }, } ) ), ] )( ModeSwitcher ); diff --git a/packages/edit-post/src/components/header/more-menu/index.js b/packages/edit-post/src/components/header/more-menu/index.js index 223c2c0f27261..5255740df260f 100644 --- a/packages/edit-post/src/components/header/more-menu/index.js +++ b/packages/edit-post/src/components/header/more-menu/index.js @@ -33,8 +33,8 @@ const MoreMenu = () => ( ) } renderContent={ ( { onClose } ) => ( - - + + diff --git a/packages/edit-post/src/components/header/writing-menu/index.js b/packages/edit-post/src/components/header/writing-menu/index.js index 5a909d1c6ab38..0484e32c28cd6 100644 --- a/packages/edit-post/src/components/header/writing-menu/index.js +++ b/packages/edit-post/src/components/header/writing-menu/index.js @@ -10,7 +10,7 @@ import { ifViewportMatches } from '@wordpress/viewport'; */ import FeatureToggle from '../feature-toggle'; -function WritingMenu( { onClose } ) { +function WritingMenu() { return ( @@ -27,7 +26,6 @@ function WritingMenu( { onClose } ) { feature="focusMode" label={ __( 'Spotlight Mode' ) } info={ __( 'Focus on one block at a time' ) } - onToggle={ onClose } messageActivated={ __( 'Spotlight mode activated' ) } messageDeactivated={ __( 'Spotlight mode deactivated' ) } /> @@ -35,7 +33,6 @@ function WritingMenu( { onClose } ) { feature="fullscreenMode" label={ __( 'Fullscreen Mode' ) } info={ __( 'Work without distraction' ) } - onToggle={ onClose } messageActivated={ __( 'Fullscreen mode activated' ) } messageDeactivated={ __( 'Fullscreen mode deactivated' ) } />