From 9f07b4cb1edf030ac10a81640ce77d9d2583cb63 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 5 Nov 2020 12:23:47 +0100 Subject: [PATCH] Focus on submit button by default in upload dialog Makes it possible to submit directly with enter after pasting Signed-off-by: Vincent Petry --- src/components/UploadEditor.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/UploadEditor.vue b/src/components/UploadEditor.vue index 085eae08b7f..2137773be9b 100644 --- a/src/components/UploadEditor.vue +++ b/src/components/UploadEditor.vue @@ -56,7 +56,7 @@ - @@ -115,12 +115,24 @@ export default { }, watch: { + showModal(show) { + if (show) { + this.focus() + } + }, + currentUploadId() { this.modalDismissed = false }, }, methods: { + focus() { + this.$nextTick(() => { + this.$refs.submitButton.focus() + }) + }, + handleDismiss() { this.modalDismissed = true },