forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
react-native-web+0.19.13+004+fixPointerEventDown.patch
43 lines (41 loc) · 2.62 KB
/
react-native-web+0.19.13+004+fixPointerEventDown.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
diff --git a/node_modules/react-native-web/dist/modules/useResponderEvents/ResponderSystem.js b/node_modules/react-native-web/dist/modules/useResponderEvents/ResponderSystem.js
index 0aec2d6..a71aec2 100644
--- a/node_modules/react-native-web/dist/modules/useResponderEvents/ResponderSystem.js
+++ b/node_modules/react-native-web/dist/modules/useResponderEvents/ResponderSystem.js
@@ -133,7 +133,7 @@ to return true:wantsResponderID| |
import createResponderEvent from './createResponderEvent';
import { isCancelish, isEndish, isMoveish, isScroll, isSelectionChange, isStartish } from './ResponderEventTypes';
-import { getLowestCommonAncestor, getResponderPaths, hasTargetTouches, hasValidSelection, isPrimaryPointerDown, setResponderId } from './utils';
+import { getLowestCommonAncestor, getResponderPaths, hasTargetTouches, hasValidSelection, isPrimaryOrSecondaryPointerDown, setResponderId } from './utils';
import { ResponderTouchHistoryStore } from './ResponderTouchHistoryStore';
import canUseDOM from '../canUseDom';
@@ -225,7 +225,7 @@ function eventListener(domEvent) {
}
return;
}
- var isStartEvent = isStartish(eventType) && isPrimaryPointerDown(domEvent);
+ var isStartEvent = isStartish(eventType) && isPrimaryOrSecondaryPointerDown(domEvent);
var isMoveEvent = isMoveish(eventType);
var isEndEvent = isEndish(eventType);
var isScrollEvent = isScroll(eventType);
diff --git a/node_modules/react-native-web/dist/modules/useResponderEvents/utils.js b/node_modules/react-native-web/dist/modules/useResponderEvents/utils.js
index 7382cdd..d88f6c0 100644
--- a/node_modules/react-native-web/dist/modules/useResponderEvents/utils.js
+++ b/node_modules/react-native-web/dist/modules/useResponderEvents/utils.js
@@ -148,14 +148,14 @@ export function hasValidSelection(domEvent) {
/**
* Events are only valid if the primary button was used without specific modifier keys.
*/
-export function isPrimaryPointerDown(domEvent) {
+export function isPrimaryOrSecondaryPointerDown(domEvent) {
var altKey = domEvent.altKey,
button = domEvent.button,
buttons = domEvent.buttons,
ctrlKey = domEvent.ctrlKey,
type = domEvent.type;
var isTouch = type === 'touchstart' || type === 'touchmove';
- var isPrimaryMouseDown = type === 'mousedown' && (button === 0 || buttons === 1);
+ var isPrimaryMouseDown = type === 'mousedown' && (button === 0 || buttons === 1 || buttons === 2);
var isPrimaryMouseMove = type === 'mousemove' && buttons === 1;
var noModifiers = altKey === false && ctrlKey === false;
if (isTouch || isPrimaryMouseDown && noModifiers || isPrimaryMouseMove && noModifiers) {