Fix event replaying logic (#19269)
Dominic Gannaway committed
Jul 7, 2020 at 02:28 UTC
97b96da2954ac58f06d237592b5e5243edde480f
1 file changed
+6
-2
packages/react-dom/src/events/ReactDOMEventReplaying.js
+6
-2
@@ -135,7 +135,10 @@ import {
135
TOP_BLUR,
136
} from './DOMTopLevelEventTypes';
137
import {IS_REPLAYED, PLUGIN_EVENT_SYSTEM} from './EventSystemFlags';
138
-import {listenToTopLevelEvent} from './DOMModernPluginEventSystem';
138
+import {
139
+ listenToTopLevelEvent,
140
+ capturePhaseEvents,
141
+} from './DOMModernPluginEventSystem';
142
import {addResponderEventSystemEvent} from './DeprecatedDOMEventResponderSystem';
143
144
type QueuedReplayableEvent = {|
@@ -236,12 +239,13 @@ function trapReplayableEventForContainer(
239
container: Container,
240
listenerMap: ElementListenerMap,
241
) {
242
+ const capture = capturePhaseEvents.has(topLevelType);
243
listenToTopLevelEvent(
244
topLevelType,
245
((container: any): Element),
246
listenerMap,
247
PLUGIN_EVENT_SYSTEM,
244
- false,
248
+ capture,
249
);
250
}
251