refs #1782 Avoid shortcut key on media description in new toot

This commit is contained in:
AkiraFukushima 2020-11-20 01:32:38 +09:00
parent 8487263c27
commit 3a579cc39b
1 changed files with 1 additions and 15 deletions

View File

@ -45,8 +45,7 @@
:placeholder="$t('modals.new_toot.description')"
:value="mediaDescriptions[media.id]"
@input="updateDescription(media.id, $event.target.value)"
v-shortkey="{ left: ['arrowleft'], right: ['arrowright'] }"
@shortkey="handleDescriptionKey"
v-shortkey.avoid
role="textbox"
contenteditable="true"
aria-multiline="true"
@ -388,19 +387,6 @@ export default {
.catch(_ => {})
}
},
handleDescriptionKey(event) {
const current = event.target.selectionStart
switch (event.srcKey) {
case 'left':
event.target.setSelectionRange(current - 1, current - 1)
break
case 'right':
event.target.setSelectionRange(current + 1, current + 1)
break
default:
return true
}
},
updateDescription(id, value) {
this.$store.commit('TimelineSpace/Modals/NewToot/updateMediaDescription', { id: id, description: value })
},