refs #1782 Avoid shortcut key on media description in new toot
This commit is contained in:
parent
8487263c27
commit
3a579cc39b
|
@ -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 })
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue