Skip to content

Commit

Permalink
fix: only focus on input if modal is open
Browse files Browse the repository at this point in the history
Signed-off-by: Cleopatra Enjeck M <patrathewhiz@gmail.com>
  • Loading branch information
enjeck committed Aug 9, 2024
1 parent b2e62c1 commit 3339924
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/modules/modals/CreateColumn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,11 @@ export default {
deep: true,
},
showModal() {
this.$nextTick(() => {
this.$el.querySelector('input')?.focus()
})
if (this.showModal) {
this.$nextTick(() => {
this.$el.querySelector('input')?.focus()
})

Check failure on line 266 in src/modules/modals/CreateColumn.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected tab character

Check failure on line 266 in src/modules/modals/CreateColumn.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Trailing spaces not allowed
}
},
},
methods: {
Expand Down
8 changes: 5 additions & 3 deletions src/modules/modals/CreateRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ export default {
},
watch: {
showModal() {
this.$nextTick(() => {
this.$el.querySelector('input')?.focus()
})
if (this.showModal) {
this.$nextTick(() => {
this.$el.querySelector('input')?.focus()
})
}
},
},
methods: {
Expand Down

0 comments on commit 3339924

Please sign in to comment.