Skip to content

Commit

Permalink
avoid console error on shortcut focus
Browse files Browse the repository at this point in the history
  • Loading branch information
dmstern committed Aug 14, 2018
1 parent 6c23123 commit 977f11e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export default class App extends Vue {
window.onresize = this.adaptContentSpacing;
window.addEventListener('keypress', (e) => {
if (String.fromCharCode(e.keyCode) === '/' || String.fromCharCode(e.keyCode) === '#') {
if (e.target !== this.searchInput) {
if (!this.searchInput || e.target !== this.searchInput) {
this.focusSearch();
}
}
Expand Down

0 comments on commit 977f11e

Please sign in to comment.