diff --git a/packages/react-native-web-examples/package.json b/packages/react-native-web-examples/package.json index fd2ec74f..d7b3a9bc 100644 --- a/packages/react-native-web-examples/package.json +++ b/packages/react-native-web-examples/package.json @@ -14,5 +14,9 @@ "react-dom": "^17.0.2", "react-native-web": "0.18.6" }, + "devDependencies": { + "@babel/core": "^7.18.6", + "@babel/preset-flow": "^7.18.6" + }, "license": "MIT" } diff --git a/packages/react-native-web/src/modules/usePressEvents/PressResponder.js b/packages/react-native-web/src/modules/usePressEvents/PressResponder.js index 1efceee5..2b03203d 100644 --- a/packages/react-native-web/src/modules/usePressEvents/PressResponder.js +++ b/packages/react-native-web/src/modules/usePressEvents/PressResponder.js @@ -482,7 +482,12 @@ export default class PressResponder { event: ResponderEvent ): void { if (isTerminalSignal(signal)) { - this._isPointerTouch = false; + // Pressable suppression of contextmenu on windows. + // On Windows, the contextmenu is displayed after pointerup. + // https://github.com/necolas/react-native-web/issues/2296 + setTimeout(() => { + this._isPointerTouch = false; + }, 0); this._touchActivatePosition = null; this._cancelLongPressDelayTimeout(); }