Fix shift-ctrl-click
isOnlyCtrlOrCmdKeyEvent is predicated on !shiftKey, so another function was needed for cases where we ignore other keys
This commit is contained in:
parent
85cdd888e8
commit
d495519986
2 changed files with 11 additions and 2 deletions
|
@ -68,3 +68,12 @@ export function isOnlyCtrlOrCmdKeyEvent(ev) {
|
|||
return ev.ctrlKey && !ev.altKey && !ev.metaKey && !ev.shiftKey;
|
||||
}
|
||||
}
|
||||
|
||||
export function isCtrlOrCmdKeyEvent(ev) {
|
||||
const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
|
||||
if (isMac) {
|
||||
return ev.metaKey && !ev.ctrlKey;
|
||||
} else {
|
||||
return ev.ctrlKey && !ev.metaKey;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue