Skip to content

Commit ffc850b

Browse files
gwennlbhsimonwep
authored andcommitted
docs: don't clear selection when starting a range selection
As range selection is enabled by default, no including `!event.shiftKey` in the condition for clearing the selection gives a misleading example
1 parent 9d902cd commit ffc850b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/pages/frameworks/vanilla.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const selection = new SelectionArea({
5656
selectables: ['.container > div'], // Specifies the elements that can be selected
5757
boundaries: ['.container'], // Specifies the boundaries of each selection
5858
}).on('start', ({ store, event }) => {
59-
if (!event.ctrlKey && !event.metaKey) { // Clear selection if no modifier key is pressed
59+
if (!event.ctrlKey && !event.metaKey && !event.shiftKey) { // Clear selection if no modifier key is pressed
6060
store.stored.forEach(el => el.classList.remove('selected'));
6161
selection.clearSelection();
6262
}

0 commit comments

Comments
 (0)