Skip to content

Commit

Permalink
Skip announcing deselected blocks when using Home and End keys for th…
Browse files Browse the repository at this point in the history
…e selection
  • Loading branch information
andrewserong committed Mar 8, 2022
1 parent 7c81520 commit 6a53419
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@ export default function useBlockSelection() {
// the total number of blocks deselected is greater than one.
const updatedSelectedBlocks = getSelectedBlockClientIds();

// If the selection is greater than 1 and the Home or End keys
// were used to generate the selection, then skip announcing the
// deselected blocks.
if (
( event.keyCode === HOME || event.keyCode === END ) &&
updatedSelectedBlocks.length > 1
) {
return;
}

const selectionDiff = difference(
selectedBlocks,
updatedSelectedBlocks
Expand Down

0 comments on commit 6a53419

Please sign in to comment.