Skip to content

Commit

Permalink
Fixed #1330 - Input components inside DataTable break when upgrading …
Browse files Browse the repository at this point in the history
…from PrimeVue 1 to PrimeVue 2
  • Loading branch information
yigitfindikli committed Sep 29, 2021
1 parent 18eb439 commit 6d38993
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/components/datatable/BodyCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,13 @@ export default {
this.children = this.$children;
},
updated() {
let query = this.editMode === 'row' ? '[autofocus]' : 'input';
let focusable = DomHandler.findSingle(this.$el, query);
if (focusable && document.activeElement != focusable) {
focusable.focus();
if (this.d_editing && this.editMode) {
let query = this.editMode === 'row' ? '[autofocus]' : 'input';
let focusable = DomHandler.findSingle(this.$el, query);
if (focusable && document.activeElement != focusable) {
focusable.focus();
}
}
},
methods: {
Expand Down Expand Up @@ -289,4 +292,4 @@ export default {
'ripple': Ripple
}
}
</script>
</script>

0 comments on commit 6d38993

Please sign in to comment.