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 14, 2024
1 parent b910772 commit 2cbfcac
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()
})
}
},
},
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 2cbfcac

Please sign in to comment.