[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
This commit is contained in:
Nicolas Gallagher
2021-05-03 10:00:14 -07:00
parent 8fdbbc8d02
commit d792bc5424
@@ -392,7 +392,7 @@ export default class PressResponder {
event.stopPropagation();
if (this._longPressDispatched || this._selectionTerminated) {
event.preventDefault();
} else if (onPress != null && event.ctrlKey === false && event.altKey === false) {
} else if (onPress != null && event.altKey === false) {
onPress(event);
}
} else {