Skip to content

Commit fad3a3b

Browse files
authored
Fix PanGestureHandler not working with custom activation criteria and no minDist set (#1594)
When using custom activation (or failure) criteria, without setting the minDist prop, the default value would default to Float.MAX_VALUE, making it impossible to activate the handler. This changes it to Float.MIN_VALUE which is also the default value in the resetConfig method.
1 parent 48cf34c commit fad3a3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class RNGestureHandlerModule(reactContext: ReactApplicationContext?) : ReactCont
198198
if (config.hasKey(KEY_PAN_MIN_DIST)) {
199199
handler.setMinDist(PixelUtil.toPixelFromDIP(config.getDouble(KEY_PAN_MIN_DIST)))
200200
} else if (hasCustomActivationCriteria) {
201-
handler.setMinDist(Float.MAX_VALUE)
201+
handler.setMinDist(Float.MIN_VALUE)
202202
}
203203
if (config.hasKey(KEY_PAN_MIN_POINTERS)) {
204204
handler.setMinPointers(config.getInt(KEY_PAN_MIN_POINTERS))

0 commit comments

Comments
 (0)