Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,10 @@ open class GestureHandler {
protected open fun onCancel() {}
protected open fun onFail() {}

fun recordHandlerIfNotPresent() {
hostDetectorView?.recordHandlerIfNotPresent(this)
}

private fun isButtonInConfig(clickedButton: Int): Boolean {
if (mouseButton == 0) {
return clickedButton == MotionEvent.BUTTON_PRIMARY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ class RNGestureHandlerModule(reactContext: ReactApplicationContext?) :
}
}

if (newState == GestureHandler.STATE_ACTIVE || newState == GestureHandler.STATE_BEGAN) {
handler.recordHandlerIfNotPresent()
}

when (newState) {
GestureHandler.STATE_ACTIVE -> handler.activate(force = true)
GestureHandler.STATE_BEGAN -> handler.begin()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { State } from '../State';
import { tagMessage } from '../utils';
import IGestureHandler from '../web/handlers/IGestureHandler';
import GestureHandlerOrchestrator from '../web/tools/GestureHandlerOrchestrator';
import NodeManager from '../web/tools/NodeManager';
import { GestureStateManagerType } from './gestureStateManager';

Expand All @@ -20,6 +21,7 @@ export const GestureStateManager: GestureStateManagerType = {
const handler = NodeManager.getHandler(handlerTag);
ensureHandlerAttached(handler);

GestureHandlerOrchestrator.instance.recordHandlerIfNotPresent(handler);
handler.begin();
},

Expand All @@ -33,6 +35,7 @@ export const GestureStateManager: GestureStateManagerType = {
handler.begin();
}

GestureHandlerOrchestrator.instance.recordHandlerIfNotPresent(handler);
handler.activate(true);
},

Expand Down
Loading