Fixed keyboard shortcut for opening search

refs https://github.com/TryGhost/Team/issues/1665

- fix browser hijack of cmd/ctrl + k shortcut for search
This commit is contained in:
Rishabh 2022-07-06 15:52:33 +02:00
parent 4743c3939f
commit 52d00ecc72

View File

@ -63,10 +63,12 @@ export default class App extends React.Component {
addKeyboardShortcuts() {
this.handleKeyDown = (e) => {
if (e.keyCode === 75 && e.metaKey) {
if (e.key === 'k' && e.metaKey) {
this.setState({
showPopup: true
});
e.preventDefault();
e.stopPropagation();
return false;
}
};