You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicdispatchEvent(event: Event): void{
const owner=this.node;lettarget: Node;leti=0;event.target=owner;// Event.CAPTURING_PHASE_cachedArray.length=0;this.getCapturingTargets(event.type,_cachedArray);// capturingevent.eventPhase=1;for(i=_cachedArray.length-1;i>=0;--i){target=_cachedArray[i];if(target.eventProcessor.capturingTarget){event.currentTarget=target;// fire eventtarget.eventProcessor.capturingTarget.emit(event.type,event,_cachedArray);// check if propagation stoppedif(event.propagationStopped){_cachedArray.length=0;return;}}}_cachedArray.length=0;// Event.AT_TARGET// checks if destroyed in capturing callbacksevent.eventPhase=2;event.currentTarget=owner;if(this.capturingTarget){this.capturingTarget.emit(event.type,event);}if(!event.propagationImmediateStopped&&this.bubblingTarget){this.bubblingTarget.emit(event.type,event);}if(!event.propagationStopped&&event.bubbles){// Event.BUBBLING_PHASEthis.getBubblingTargets(event.type,_cachedArray);// propagateevent.eventPhase=3;for(i=0;i<_cachedArray.length;++i){target=_cachedArray[i];if(target.eventProcessor.bubblingTarget){event.currentTarget=target;// fire eventtarget.eventProcessor.bubblingTarget.emit(event.type,event);// check if propagation stoppedif(event.propagationStopped){_cachedArray.length=0;return;}}}}_cachedArray.length=0;}
If an event is dispatched during the capture or bubbling phase, the event also has a "capture" type listener, which will result in an error.
When there are more than two objects listening to capture events, target is null because the array is cleared.
Cocos Creator version
3.8.2
System information
MacOS
Issue description
node-event-processor.ts:
If an event is dispatched during the capture or bubbling phase, the event also has a "capture" type listener, which will result in an error.
When there are more than two objects listening to capture events, target is null because the array is cleared.
Relevant error log output
No response
Steps to reproduce
.
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: