1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

feat: auto focus on first input in modals

This commit is contained in:
2020-12-11 18:09:17 +01:00
parent 797ab70e7c
commit 1476e899d1
11 changed files with 69 additions and 3 deletions

View File

@ -20,6 +20,7 @@
</div>
<div class="col-8 col-sm-12">
<input
ref="firstInput"
v-model="localConnection.name"
class="form-input"
type="text"
@ -172,6 +173,10 @@ export default {
created () {
this.localConnection = Object.assign({}, this.connection);
window.addEventListener('keydown', this.onKey);
setTimeout(() => {
this.$refs.firstInput.focus();
}, 20);
},
beforeDestroy () {
window.removeEventListener('keydown', this.onKey);