Skip to content

Commit

Permalink
Update node-event-processor.ts
Browse files Browse the repository at this point in the history
问题:event.propagationImmediateStopped=true 没有阻止事件冒泡传递。按API 描述,这边不是应该加上&& !event.propagationImmediateStopped吗
===========
一直以为是event.propagationStopped的强化版。
如果设计没问题能否补充 API 说明和官方文档的使用说明
  • Loading branch information
zhangyuantao authored Sep 20, 2024
1 parent 486c562 commit 05c3836
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cocos/scene-graph/node-event-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 05c3836

Please sign in to comment.