diff --git a/common/changes/@visactor/vrender-kits/fix-gesture-compatible_2024-12-23-09-54.json b/common/changes/@visactor/vrender-kits/fix-gesture-compatible_2024-12-23-09-54.json new file mode 100644 index 000000000..66f46320a --- /dev/null +++ b/common/changes/@visactor/vrender-kits/fix-gesture-compatible_2024-12-23-09-54.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vrender-kits", + "comment": "fix: fix issue with gesture emitEvent when gesture is released", + "type": "none" + } + ], + "packageName": "@visactor/vrender-kits" +} \ No newline at end of file diff --git a/packages/vrender-kits/src/event/extension/gesture.ts b/packages/vrender-kits/src/event/extension/gesture.ts index d5319d136..24d7988c9 100644 --- a/packages/vrender-kits/src/event/extension/gesture.ts +++ b/packages/vrender-kits/src/event/extension/gesture.ts @@ -423,6 +423,9 @@ export class Gesture extends EventEmitter { } private emitEvent(type: string, e: GestureEvent) { + if (!this.element) { + return; + } const events = (this.element as unknown as any)._events; const listeners = events[WILDCARD]; if (listeners) {