From 50dce0f72ace7fca017e94afa66fc65bb9769cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bert?= Date: Thu, 1 Feb 2024 13:19:57 +0100 Subject: [PATCH 1/2] Reset handler --- src/web/handlers/GestureHandler.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/web/handlers/GestureHandler.ts b/src/web/handlers/GestureHandler.ts index 3a15283060..0cfc588f48 100644 --- a/src/web/handlers/GestureHandler.ts +++ b/src/web/handlers/GestureHandler.ts @@ -118,6 +118,10 @@ export default abstract class GestureHandler { ); this.onStateChange(newState, oldState); + + if (!this.enabled && newState === State.END) { + this.currentState = State.UNDETERMINED; + } } protected onStateChange(_newState: State, _oldState: State): void {} From 05a19811ef8ff94ad1c6a01430836edd8431acc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bert?= Date: Fri, 2 Feb 2024 13:40:30 +0100 Subject: [PATCH 2/2] Change condition to isFinished --- src/web/handlers/GestureHandler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web/handlers/GestureHandler.ts b/src/web/handlers/GestureHandler.ts index 0cfc588f48..9b971f88e7 100644 --- a/src/web/handlers/GestureHandler.ts +++ b/src/web/handlers/GestureHandler.ts @@ -119,7 +119,7 @@ export default abstract class GestureHandler { this.onStateChange(newState, oldState); - if (!this.enabled && newState === State.END) { + if (!this.enabled && this.isFinished()) { this.currentState = State.UNDETERMINED; } }