Merge pull request #369 from nextcloud/design/focus-title

Focus title after form load
This commit is contained in:
Jan-Christoph Borchardt 2020-05-09 19:43:55 +02:00 committed by GitHub
commit 2342b232f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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"
@ -236,9 +237,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
*/