Skip to content

Commit

Permalink
Move is-navigate-mode class to WritingFlow (#19868)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jan 24, 2020
1 parent f6eb4ec commit 23493b7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
1 change: 0 additions & 1 deletion packages/block-editor/src/components/block-list/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ function BlockListBlock( {
'has-selected-ui': hasSelectedUI,
'has-warning': ! isValid || !! hasError || isUnregisteredBlock,
'is-selected': shouldAppearSelected && hasSelectedUI,
'is-navigate-mode': isNavigationMode,
'is-multi-selected': isMultiSelected,
'is-reusable': isReusableBlock( blockType ),
'is-dragging': isDragging,
Expand Down
4 changes: 2 additions & 2 deletions packages/block-editor/src/components/block-list/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
}
}

&.is-navigate-mode::before {
.is-navigate-mode &::before {
border-color: $blue-medium-focus;
box-shadow: inset $block-left-border-width 0 0 0 $blue-medium-focus;

Expand Down Expand Up @@ -277,7 +277,7 @@
}

// Select tool/navigation mode shows the default cursor until an additional click edits.
&.is-navigate-mode {
.is-navigate-mode & {
cursor: default;
}

Expand Down
7 changes: 6 additions & 1 deletion packages/block-editor/src/components/writing-flow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* External dependencies
*/
import { overEvery, find, findLast, reverse, first, last } from 'lodash';
import classnames from 'classnames';

/**
* WordPress dependencies
Expand Down Expand Up @@ -505,11 +506,15 @@ export default function WritingFlow( { children } ) {
}
}, [ hasMultiSelection, isMultiSelecting ] );

const className = classnames( 'block-editor-writing-flow', {
'is-navigate-mode': isNavigationMode,
} );

// Disable reason: Wrapper itself is non-interactive, but must capture
// bubbling events from children to determine focus transition intents.
/* eslint-disable jsx-a11y/no-static-element-interactions */
return (
<div className="block-editor-writing-flow">
<div className={ className }>
<FocusCapture
ref={ focusCaptureBeforeRef }
selectedClientId={ selectedBlockClientId }
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/block/edit-panel/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
}
}

.is-selected.is-navigate-mode .reusable-block-edit-panel {
.is-navigate-mode .is-selected .reusable-block-edit-panel {
border-color: $blue-medium-focus;
border-left-color: transparent;

Expand Down

0 comments on commit 23493b7

Please sign in to comment.