diff options
| author | Hunternif | 2019-04-13 19:39:51 +0700 |
|---|---|---|
| committer | Hunternif | 2019-04-13 19:42:25 +0700 |
| commit | bbded5212688a0d75c0d9436f9d637246ff1d02c (patch) | |
| tree | 4ab35caa0e0607fc336f90871346d09967dd9c1e | |
| parent | 1fb213b3465b58f9165c061c77380300b4e71d5c (diff) | |
Prevent typing when focusing input
| -rw-r--r-- | client/js/util/search.js | 3 | ||||
| -rw-r--r-- | client/js/views/post_main_view.js | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/client/js/util/search.js b/client/js/util/search.js index 8d5fca4..9cfa8cb 100644 --- a/client/js/util/search.js +++ b/client/js/util/search.js @@ -5,7 +5,8 @@ const keyboard = require('../util/keyboard.js'); const views = require('./views.js'); function searchInputNodeFocusHelper(inputNode) { - keyboard.bind('q', () => { + keyboard.bind('q', (e) => { + e.preventDefault(); inputNode.focus(); inputNode.setSelectionRange( inputNode.value.length, inputNode.value.length); diff --git a/client/js/views/post_main_view.js b/client/js/views/post_main_view.js index 7718dea..e137bc7 100644 --- a/client/js/views/post_main_view.js +++ b/client/js/views/post_main_view.js @@ -87,8 +87,9 @@ class PostMainView { this.sidebarControl._evtDeleteClick(e); } }); - keyboard.bind('t', () => { + keyboard.bind('t', (e) => { if (ctx.editMode) { + e.preventDefault(); this.sidebarControl.focusTagInput(); } }); |