From 05c38366300e2950559a04038cd432c49d71139c Mon Sep 17 00:00:00 2001 From: ThinkDifferent <735162787@qq.com> Date: Fri, 20 Sep 2024 12:25:08 +0800 Subject: [PATCH] Update node-event-processor.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题:event.propagationImmediateStopped=true 没有阻止事件冒泡传递。按API 描述,这边不是应该加上&& !event.propagationImmediateStopped吗 =========== 一直以为是event.propagationStopped的强化版。 如果设计没问题能否补充 API 说明和官方文档的使用说明 --- cocos/scene-graph/node-event-processor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scene-graph/node-event-processor.ts b/cocos/scene-graph/node-event-processor.ts index da4c3875535..7a79a0a6758 100644 --- a/cocos/scene-graph/node-event-processor.ts +++ b/cocos/scene-graph/node-event-processor.ts @@ -290,7 +290,7 @@ export class NodeEventProcessor { this.bubblingTarget.emit(event.type, event); } - if (!event.propagationStopped && event.bubbles) { + if (!event.propagationStopped && !event.propagationImmediateStopped && event.bubbles) { // Event.BUBBLING_PHASE cachedArray.length = 0; this.getBubblingTargets(event.type, cachedArray);