@@ -40,10 +40,9 @@ import {
40
40
import { IS_EVENT_HANDLE_NON_MANAGED_NODE } from '../EventSystemFlags' ;
41
41
42
42
import getEventCharCode from '../getEventCharCode' ;
43
- import { IS_CAPTURE_PHASE , IS_NON_DELEGATED } from '../EventSystemFlags' ;
43
+ import { IS_CAPTURE_PHASE } from '../EventSystemFlags' ;
44
44
45
45
import { enableCreateEventHandleAPI } from 'shared/ReactFeatureFlags' ;
46
- import { getClosestInstanceFromNode } from '../../client/ReactDOMComponentTree' ;
47
46
48
47
function extractEvents (
49
48
dispatchQueue : DispatchQueue ,
@@ -166,22 +165,11 @@ function extractEvents(
166
165
inCapturePhase ,
167
166
) ;
168
167
} else {
169
- // When we encounter a non-delegated event in the capture phase,
170
- // we shouldn't emuluate capture bubbling. This is because we'll
171
- // add a native capture event listener to each element directly,
172
- // not the root, and native capture listeners always fire even
173
- // if the event doesn't bubble.
174
- const isNonDelegatedEvent = ( eventSystemFlags & IS_NON_DELEGATED ) !== 0 ;
175
168
// TODO: We may also want to re-use the accumulateTargetOnly flag to
176
169
// special case bubbling for onScroll/media events at a later point.
177
- const accumulateTargetOnly = inCapturePhase && isNonDelegatedEvent ;
178
- // If we are not handling accumulateTargetOnly, then we should traverse
179
- // through all React fiber tree, finding all relevant useEvent and
180
- // on* prop events as we traverse the tree. Otherwise, we should
181
- // only handle the target fiber and stop traversal straight after.
182
- if ( accumulateTargetOnly ) {
183
- targetInst = getClosestInstanceFromNode ( ( ( targetContainer : any ) : Node ) ) ;
184
- }
170
+ // In which case we will want to make this flag boolean and ensure
171
+ // we change the targetInst to be of the container instance. Like:
172
+ const accumulateTargetOnly = false ;
185
173
186
174
// We traverse only capture or bubble phase listeners
187
175
accumulateSinglePhaseListeners (
0 commit comments