Handle Ctrl+/ in the application instead of via Electron
To prevent 'select all' on Linux.
This commit is contained in:
parent
3c6e23cc5e
commit
6b60ca6bd7
3 changed files with 22 additions and 2 deletions
|
@ -217,7 +217,18 @@ export class MainHeader extends React.Component<PropsType, StateType> {
|
|||
searchTerm,
|
||||
} = this.props;
|
||||
|
||||
if (event.key !== 'Escape') {
|
||||
const { ctrlKey, metaKey, key } = event;
|
||||
const ctrlOrCommand = ctrlKey || metaKey;
|
||||
|
||||
// On linux, this keyboard combination selects all text
|
||||
if (ctrlOrCommand && key === '/') {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (key !== 'Escape') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue