refs #482 Close suggest when esc

This commit is contained in:
AkiraFukushima 2018-08-16 23:43:02 +09:00
parent 4838a1aa30
commit 43b976b521
1 changed files with 4 additions and 1 deletions

View File

@ -3,7 +3,7 @@
<textarea
v-model="status"
ref="status"
v-shortkey="openSuggest ? {up: ['arrowup'], down: ['arrowdown'], enter: ['enter']} : {linux: ['ctrl', 'enter'], mac: ['meta', 'enter'], left: ['arrowleft'], right: ['arrowright']}"
v-shortkey="openSuggest ? {up: ['arrowup'], down: ['arrowdown'], enter: ['enter'], esc: ['esc']} : {linux: ['ctrl', 'enter'], mac: ['meta', 'enter'], left: ['arrowleft'], right: ['arrowright']}"
@shortkey="handleKey"
v-on:input="startSuggest"
:placeholder="$t('modals.new_toot.status')"
@ -140,6 +140,9 @@ export default {
case 'enter':
this.selectCurrentAccount()
break
case 'esc':
this.closeSuggest()
break
case 'left':
event.target.setSelectionRange(current - 1, current - 1)
break