зеркало из https://github.com/nextcloud/spreed.git
Focus on submit button by default in upload dialog
Makes it possible to submit directly with enter after pasting Signed-off-by: Vincent Petry <vincent@nextcloud.com>
This commit is contained in:
Родитель
7d157ce07c
Коммит
9f07b4cb1e
|
@ -56,7 +56,7 @@
|
|||
<button @click="handleDismiss">
|
||||
{{ t('spreed', 'Dismiss') }}
|
||||
</button>
|
||||
<button class="primary" @click="handleUpload">
|
||||
<button ref="submitButton" class="primary" @click="handleUpload">
|
||||
{{ t('spreed', 'Send') }}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -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
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче