Skip to content

Commit

Permalink
see if removing root class has any timing differences
Browse files Browse the repository at this point in the history
  • Loading branch information
gwwar committed Jun 9, 2021
1 parent 6952ca2 commit 7069153
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions packages/block-editor/src/components/block-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,20 @@ export const IntersectionObserver = createContext();

function Root( { className, children } ) {
const isLargeViewport = useViewportMatch( 'medium' );
const {
isTyping,
isOutlineMode,
isFocusMode,
isNavigationMode,
} = useSelect( ( select ) => {
const {
isTyping: _isTyping,
getSettings,
isNavigationMode: _isNavigationMode,
} = select( blockEditorStore );
const { outlineMode, focusMode } = getSettings();
return {
isTyping: _isTyping(),
isOutlineMode: outlineMode,
isFocusMode: focusMode,
isNavigationMode: _isNavigationMode(),
};
}, [] );
const { isOutlineMode, isFocusMode, isNavigationMode } = useSelect(
( select ) => {
const { getSettings, isNavigationMode: _isNavigationMode } = select(
blockEditorStore
);
const { outlineMode, focusMode } = getSettings();
return {
isOutlineMode: outlineMode,
isFocusMode: focusMode,
isNavigationMode: _isNavigationMode(),
};
},
[]
);
return (
<div
ref={ useMergeRefs( [
Expand All @@ -57,7 +52,6 @@ function Root( { className, children } ) {
'block-editor-block-list__layout is-root-container',
className,
{
'is-typing': isTyping,
'is-outline-mode': isOutlineMode,
'is-focus-mode': isFocusMode && isLargeViewport,
'is-navigate-mode': isNavigationMode,
Expand Down

0 comments on commit 7069153

Please sign in to comment.