fix: setting hotkeys was broken (#2496)
This commit is contained in:
1 parent
4f41ba742d
commit
eff70ae22c
12 files changed
+281
-53
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import Input from '../Input';
|
||||
@@ -18,14 +18,7 @@ import { getKeys, formatKeysForInput } from './utils';
|
||||
const HotkeyField = ({ disabled, keys, onChange, className, modifierKeys, hotkeys }) => {
|
||||
const inputValue = formatKeysForInput(keys);
|
||||
|
||||
useEffect(() => {
|
||||
hotkeys.initialize();
|
||||
}, [])
|
||||
|
||||
const onInputKeyDown = event => {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
hotkeys.record(sequence => {
|
||||
const keys = getKeys({ sequence, modifierKeys });
|
||||
hotkeys.unpause();
|
||||
|
||||
Reference in new issue
Block a user