feat: allow clear shortcut

This commit is contained in:
EnixCoda 2019-02-21 11:43:34 +08:00
parent 32c0b5f03c
commit 62170293e9
No known key found for this signature in database
GPG key ID: 6825847C88AA329A

View file

@ -144,7 +144,8 @@ export default class SettingsBar extends React.PureComponent<Props, State> {
onShortCutInputKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
e.preventDefault()
const shortcut = keyHelper.parseEvent(e)
// Clear shortcut with backspace
const shortcut = e.key === 'Backspace' ? '' : keyHelper.parseEvent(e)
this.setState({ toggleShowSideBarShortcut: shortcut })
}