Skip to content

Commit d792bc5

Browse files
committed
[fix] Pressable onPress is called for ctrl+click on Windows
Pressing ctrl+click on a link opens a new tab in Windows. On macOS it opens the context menu but doesn't dispatch a 'click' event. On other element types both OS dispatch a 'click'. Removing the condition related to 'ctrlKey' produces the desired behavior across OS. Fix #2000
1 parent 8fdbbc8 commit d792bc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-native-web/src/modules/usePressEvents/PressResponder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ export default class PressResponder {
392392
event.stopPropagation();
393393
if (this._longPressDispatched || this._selectionTerminated) {
394394
event.preventDefault();
395-
} else if (onPress != null && event.ctrlKey === false && event.altKey === false) {
395+
} else if (onPress != null && event.altKey === false) {
396396
onPress(event);
397397
}
398398
} else {

0 commit comments

Comments
 (0)