macOS shortcuts: Only listen for command key, not control key

This commit is contained in:
Scott Nonnenberg 2019-12-17 10:52:36 -08:00 committed by Ken Powers
parent d86e8ef7ec
commit 2c7baad68d
10 changed files with 59 additions and 39 deletions

View file

@ -1,6 +1,6 @@
import React from 'react';
import { AutoSizer, List } from 'react-virtualized';
import { debounce } from 'lodash';
import { debounce, get } from 'lodash';
import {
ConversationListItem,
@ -128,7 +128,9 @@ export class LeftPane extends React.Component<PropsType> {
};
public handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {
const commandOrCtrl = event.metaKey || event.ctrlKey;
const commandKey = get(window, 'platform') === 'darwin' && event.metaKey;
const controlKey = get(window, 'platform') !== 'darwin' && event.ctrlKey;
const commandOrCtrl = commandKey || controlKey;
if (commandOrCtrl && !event.shiftKey && event.key === 'ArrowUp') {
this.scrollToRow(0);