Factor out isCtrlOrCmdKeyEvent, use that in TagPanel
as opposed to the incorrect ctrl || meta
This commit is contained in:
parent
3bcb3195c4
commit
fe81fcb8c6
8 changed files with 22 additions and 29 deletions
|
@ -19,7 +19,7 @@ limitations under the License.
|
|||
import * as Matrix from 'matrix-js-sdk';
|
||||
import React from 'react';
|
||||
|
||||
import KeyCode from '../../KeyCode';
|
||||
import { KeyCode, isCtrlOrCmdKeyEvent } from '../../Keyboard';
|
||||
import Notifier from '../../Notifier';
|
||||
import PageTypes from '../../PageTypes';
|
||||
import CallMediaHandler from '../../CallMediaHandler';
|
||||
|
@ -153,13 +153,7 @@ export default React.createClass({
|
|||
*/
|
||||
|
||||
let handled = false;
|
||||
const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
|
||||
let ctrlCmdOnly;
|
||||
if (isMac) {
|
||||
ctrlCmdOnly = ev.metaKey && !ev.altKey && !ev.ctrlKey && !ev.shiftKey;
|
||||
} else {
|
||||
ctrlCmdOnly = ev.ctrlKey && !ev.altKey && !ev.metaKey && !ev.shiftKey;
|
||||
}
|
||||
const ctrlCmdOnly = isCtrlOrCmdKeyEvent(ev);
|
||||
|
||||
switch (ev.keyCode) {
|
||||
case KeyCode.UP:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue