mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-12 22:14:20 +00:00
[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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user