Skip to content

Commit

Permalink
Comment tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed May 27, 2022
1 parent 9df3b24 commit c1bcac8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function ZoomOutModeInserters( { __unstableContentRef } ) {
return select( blockEditorStore ).getBlockOrder();
}, [] );

// Deffer the initial rendering to avoid the jumps due to the animation.
// Defer the initial rendering to avoid the jumps due to the animation.
useEffect( () => {
const timeout = setTimeout( () => {
setIsReady( true );
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,7 @@ export const setNavigationMode = ( isNavigationMode = true ) => ( {
* @param {string} mode Editor mode
*/
export const __unstableSetEditorMode = ( mode ) => ( { dispatch, select } ) => {
// When switching to zoom-out mode, we need to select to parent block
// When switching to zoom-out mode, we need to select to root block
if ( mode === 'zoom-out' ) {
const firstSelectedClientId = select.getBlockSelectionStart();
if ( firstSelectedClientId ) {
Expand Down
4 changes: 1 addition & 3 deletions packages/block-editor/src/store/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,7 @@ export const blockListSettings = ( state = {}, action ) => {
* @return {string} Updated state.
*/
export function editorMode( state = 'edit', action ) {
// Let inserting block always trigger Edit mode.
// Let inserting block in navigation mode always trigger Edit mode.
if ( action.type === 'INSERT_BLOCKS' && state === 'navigation' ) {
return 'edit';
}
Expand All @@ -1615,8 +1615,6 @@ export function editorMode( state = 'edit', action ) {
* @return {string|null} Updated state.
*/
export function hasBlockMovingClientId( state = null, action ) {
// Let inserting block always trigger Edit mode.

if ( action.type === 'SET_BLOCK_MOVING_MODE' ) {
return action.hasBlockMovingClientId;
}
Expand Down

0 comments on commit c1bcac8

Please sign in to comment.