From 97b96da2954ac58f06d237592b5e5243edde480f Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Tue, 7 Jul 2020 02:28:55 +0100 Subject: [PATCH] Fix event replaying logic (#19269) --- packages/react-dom/src/events/ReactDOMEventReplaying.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/react-dom/src/events/ReactDOMEventReplaying.js b/packages/react-dom/src/events/ReactDOMEventReplaying.js index 9251da4eaa637..91eb3f5e06363 100644 --- a/packages/react-dom/src/events/ReactDOMEventReplaying.js +++ b/packages/react-dom/src/events/ReactDOMEventReplaying.js @@ -135,7 +135,10 @@ import { TOP_BLUR, } from './DOMTopLevelEventTypes'; import {IS_REPLAYED, PLUGIN_EVENT_SYSTEM} from './EventSystemFlags'; -import {listenToTopLevelEvent} from './DOMModernPluginEventSystem'; +import { + listenToTopLevelEvent, + capturePhaseEvents, +} from './DOMModernPluginEventSystem'; import {addResponderEventSystemEvent} from './DeprecatedDOMEventResponderSystem'; type QueuedReplayableEvent = {| @@ -236,12 +239,13 @@ function trapReplayableEventForContainer( container: Container, listenerMap: ElementListenerMap, ) { + const capture = capturePhaseEvents.has(topLevelType); listenToTopLevelEvent( topLevelType, ((container: any): Element), listenerMap, PLUGIN_EVENT_SYSTEM, - false, + capture, ); }