From d4804298967188019c2b7a48221194bc0c1979b2 Mon Sep 17 00:00:00 2001 From: Sol Fisher Romanoff Date: Thu, 14 Jul 2022 22:36:14 +0300 Subject: [PATCH] Allow ctrl+enter posting when focused on alt text --- src/components/attachment/attachment.js | 6 ++++++ src/components/attachment/attachment.vue | 1 + 2 files changed, 7 insertions(+) diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index 65301e84..5450f7a1 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -126,6 +126,9 @@ const Attachment = { videoTag () { return this.useModal ? 'button' : 'span' }, + statusForm () { + return this.$parent.$parent + }, ...mapGetters(['mergedConfig']) }, watch: { @@ -219,6 +222,9 @@ const Attachment = { const newHeight = Math.floor(target.scrollHeight - padding * 2) target.style.height = `${newHeight}px` this.$emit('resize', newHeight) + }, + postStatus (event) { + console.log(this.statusForm.postStatus(event, this.statusForm.newStatus)) } } } diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index f2354524..947b1bfc 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -255,6 +255,7 @@ :placeholder="$t('post_status.media_description')" rows="1" cols="1" + @keydown.ctrl.enter="postStatus()" @input="resize" />