Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Feb 20, 2024
1 parent feab691 commit 67b6b53
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,7 @@ export default function useIndentListItem( clientId ) {
clonedBlocks[ clonedBlocks.length - 1 ].clientId
);
}

return true;
}, [ clientId ] );
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,7 @@ export default function useOutdentListItem() {
removeBlock( parentListId, shouldSelectParent );
}
} );

return true;
}, [] );
}
9 changes: 6 additions & 3 deletions packages/block-library/src/list-item/hooks/use-space.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,17 @@ export default function useSpace( clientId ) {
selectionStart.offset === 0 &&
selectionEnd.offset === 0
) {
event.preventDefault();
if ( shiftKey ) {
// Note that backspace behaviour in defined in onMerge.
if ( keyCode === TAB ) {
outdentListItem();
if ( outdentListItem() ) {
event.preventDefault();
}
}
} else if ( getBlockIndex( clientId ) !== 0 ) {
indentListItem();
if ( indentListItem() ) {
event.preventDefault();
}
}
}
}
Expand Down

0 comments on commit 67b6b53

Please sign in to comment.