Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add trigger-property documentation #218

Merged
merged 1 commit into from
Dec 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/vanilla/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,21 @@ const selection = new SelectionArea({
// Or specifiy the threshold for each axis by passing an object like {x: <number>, y: <number>}.
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. <CTRL + SHIFT + LEFT-CLICK> OR <RIGHT-CLICK> 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: {

Expand Down