MCPcopy Create free account
hub / github.com/reactjs/react-rails / queueIfContinuousEvent

Function queueIfContinuousEvent

lib/assets/react-source/development/react.js:7485–7529  ·  view source on GitHub ↗
(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent)

Source from the content-addressed store, hash-verified

7483 }
7484
7485 function queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {
7486 // These set relatedTarget to null because the replayed event will be treated as if we
7487 // moved from outside the window (no target) onto the target once it hydrates.
7488 // Instead of mutating we could clone the event.
7489 switch (topLevelType) {
7490 case TOP_FOCUS:
7491 {
7492 var focusEvent = nativeEvent;
7493 queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, topLevelType, eventSystemFlags, container, focusEvent);
7494 return true;
7495 }
7496
7497 case TOP_DRAG_ENTER:
7498 {
7499 var dragEvent = nativeEvent;
7500 queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, topLevelType, eventSystemFlags, container, dragEvent);
7501 return true;
7502 }
7503
7504 case TOP_MOUSE_OVER:
7505 {
7506 var mouseEvent = nativeEvent;
7507 queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, topLevelType, eventSystemFlags, container, mouseEvent);
7508 return true;
7509 }
7510
7511 case TOP_POINTER_OVER:
7512 {
7513 var pointerEvent = nativeEvent;
7514 var pointerId = pointerEvent.pointerId;
7515 queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, topLevelType, eventSystemFlags, container, pointerEvent));
7516 return true;
7517 }
7518
7519 case TOP_GOT_POINTER_CAPTURE:
7520 {
7521 var _pointerEvent = nativeEvent;
7522 var _pointerId2 = _pointerEvent.pointerId;
7523 queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, topLevelType, eventSystemFlags, container, _pointerEvent));
7524 return true;
7525 }
7526 }
7527
7528 return false;
7529 } // Check if this target is unblocked. Returns true if it's unblocked.
7530
7531 function attemptExplicitHydrationTarget(queuedTarget) {
7532 // TODO: This function shares a lot of logic with attemptToDispatchEvent.

Callers 1

dispatchEventFunction · 0.85

Tested by

no test coverage detected