From 1ae9358269d094c9563ec1a1bbd8d8d3e0e5e04a Mon Sep 17 00:00:00 2001 From: Gwenn Le Bihan Date: Thu, 11 Sep 2025 15:54:36 +0200 Subject: [PATCH] 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 --- docs/pages/frameworks/vanilla.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/frameworks/vanilla.md b/docs/pages/frameworks/vanilla.md index 0913c04..04e3cb2 100644 --- a/docs/pages/frameworks/vanilla.md +++ b/docs/pages/frameworks/vanilla.md @@ -56,7 +56,7 @@ const selection = new SelectionArea({ selectables: ['.container > div'], // Specifies the elements that can be selected boundaries: ['.container'], // Specifies the boundaries of each selection }).on('start', ({ store, event }) => { - if (!event.ctrlKey && !event.metaKey) { // Clear selection if no modifier key is pressed + if (!event.ctrlKey && !event.metaKey && !event.shiftKey) { // Clear selection if no modifier key is pressed store.stored.forEach(el => el.classList.remove('selected')); selection.clearSelection(); }