Focus title after form load

Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
This commit is contained in:
Jan-Christoph Borchardt 2020-05-09 17:05:05 +02:00
parent 259941cc00
commit 7259f72307
No known key found for this signature in database
GPG key ID: CBD846FC845CBE17

View file

@ -47,6 +47,7 @@
<label class="hidden-visually" for="form-title">{{ t('forms', 'Form title') }}</label>
<input
id="form-title"
ref="title"
v-model="form.title"
:minlength="0"
:maxlength="maxStringLengths.formTitle"
@ -229,9 +230,21 @@ export default {
this.errorForm = true
} finally {
this.isLoadingForm = false
if (this.form.title === '') {
this.focusTitle()
}
}
},
/**
* Focus title after form load
*/
focusTitle() {
this.$nextTick(() => {
this.$refs.title.focus()
})
},
/**
* Title & description save methods
*/