Merge pull request #369 from nextcloud/design/focus-title
Focus title after form load
This commit is contained in:
commit
2342b232f7
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue