Skip to content

Commit ae7147e

Browse files
henryklukasikmosinve
authored andcommitted
fix(table): only call provider once DOM is fully updated (bootstrap-vue#1904) (bootstrap-vue#1955)
* fix(table): only call provider once DOM is fully updated (bootstrap-vue#1904) * fixing lint error.
1 parent 9ab23ef commit ae7147e

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/components/table/table.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -995,17 +995,20 @@ export default {
995995
}
996996
// Set internal busy state
997997
this.localBusy = true
998-
// Call provider function with context and optional callback
999-
const data = this.items(this.context, this._providerSetLocal)
1000-
if (data && data.then && typeof data.then === 'function') {
1001-
// Provider returned Promise
1002-
data.then(items => {
1003-
this._providerSetLocal(items)
1004-
})
1005-
} else {
1006-
// Provider returned Array data
1007-
this._providerSetLocal(data)
1008-
}
998+
999+
// Call provider function with context and optional callback after DOM is fully updated
1000+
this.$nextTick(function () {
1001+
const data = this.items(this.context, this._providerSetLocal)
1002+
if (data && data.then && typeof data.then === 'function') {
1003+
// Provider returned Promise
1004+
data.then(items => {
1005+
this._providerSetLocal(items)
1006+
})
1007+
} else {
1008+
// Provider returned Array data
1009+
this._providerSetLocal(data)
1010+
}
1011+
})
10091012
},
10101013
getTdValues (item, key, tdValue, defValue) {
10111014
const parent = this.$parent

0 commit comments

Comments
 (0)