You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: documentation/pages/docs/options.mdx
+20-1
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,7 @@ Here are all options that can be applied to gestures.
104
104
|[`preventDefault`](#preventdefault)|**all**| Will `preventDefault` all events triggered by the handler. |
105
105
|[`triggerAllEvents`](#triggerallevents)|**all**| Forces the handler to fire even for non intentional displacement (ignores the `threshold`). In that case, the `intentional` attribute from state will remain `false` until the threshold is reached. |
106
106
|[`axis`](#axis)|**all**| Your handler will only trigger if a movement is detected on the specified axis. |
107
+
|[`axisThreshold`](#axisthreshold)|**xy**| Axes are calculated based on a threshold. For drag, thresholds are specified per device type. |
107
108
|[`bounds`](#bounds)|**xy**| Limits the gesture `offset` to the specified bounds. |
108
109
|[`scaleBounds`](#scalebounds)|**pinch**| Limits the scale `offset` to the specified bounds. |
109
110
|[`angleBounds`](#anglebounds)|**pinch**| Limits the angle `offset` to the specified bounds. |
@@ -181,6 +182,22 @@ function LockAxisExample() {
181
182
}
182
183
```
183
184
185
+
### axisThreshold
186
+
187
+
A gesture axis is determined whenever x-axis and y-axis displacements reach a threshold.
188
+
189
+
#### xy gestures (except for drag)
190
+
191
+
<Specstypes="number"defaultValue={0} />
192
+
193
+
For non-drag xy gestures, that threshold is always a number, which defaults to `0`.
Drag logic is the same, but you must specify the threshold for a specific device. Since pen is much more sensitive than other devices, the default threshold has been empirically set to `8`.
200
+
184
201
### bounds
185
202
186
203
<Specs
@@ -560,7 +577,7 @@ function Transform() {
560
577
}
561
578
```
562
579
563
-
> When you use the `useGesture` hook, you can set the `transform` option at the shared level and at the gesture level, with the `transform` set at the gesture level oveerriding the shared one.
580
+
> When you use the `useGesture` hook, you can set the `transform` option at the shared level and at the gesture level, with the `transform` set at the gesture level overriding the shared one.
Forces the handler to fire even for non intentional displacement (ignores the `threshold`). In that case, the `intentional` attribute from state will remain `false` until the threshold is reached.
579
596
597
+
> At this point, this option will not work as expected when using `preventScroll` or `preventScrollAxis`. Please flag an issue if this breaks your usecase.
0 commit comments