From 325f76f6ba0be22d9b2bea85264929b902a01b4e Mon Sep 17 00:00:00 2001 From: Piotr Michalak <33657122+Pietrrrek@users.noreply.github.com> Date: Wed, 13 Dec 2023 10:17:12 +0000 Subject: [PATCH] doc: add trigger-property documentation --- packages/vanilla/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/vanilla/README.md b/packages/vanilla/README.md index 59a73cf..aaef1e2 100644 --- a/packages/vanilla/README.md +++ b/packages/vanilla/README.md @@ -136,6 +136,21 @@ const selection = new SelectionArea({ // Or specifiy the threshold for each axis by passing an object like {x: , y: }. startThreshold: 10, + // List of triggers that should cause the selection to begin. + // Each element in the list can be one of the following + // - a MouseButton (numbers 0 through 4) + // see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button#value + // - an object of shape { button: MouseButton, modifiers: Modifier[] } + // where a Modifier is ( 'ctrl' | 'meta' | 'alt' | 'shift' ) + // + // To trigger the selection with e.g. OR the + // trigger property should look like + // + // triggers: [ { button: 0, modifiers: [ "ctrl", "shift" ] }, 2 ] + // + // The default value is [0], enabling only the main mouse button (usually left click). + triggers: [0] + // Scroll configuration. scrolling: {