From 1b2b341f2bd01ef0cd3883a61bd5373e672bc0af Mon Sep 17 00:00:00 2001 From: hlukasik Date: Fri, 20 Jul 2018 15:54:08 -0400 Subject: [PATCH 1/2] fix(table): only call provider once DOM is fully updated (#1904) --- src/components/table/table.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/components/table/table.js b/src/components/table/table.js index 294dfb9303e..c45ffb6ca57 100644 --- a/src/components/table/table.js +++ b/src/components/table/table.js @@ -995,17 +995,20 @@ export default { } // Set internal busy state this.localBusy = true - // Call provider function with context and optional callback - const data = this.items(this.context, this._providerSetLocal) - if (data && data.then && typeof data.then === 'function') { - // Provider returned Promise - data.then(items => { - this._providerSetLocal(items) - }) - } else { - // Provider returned Array data - this._providerSetLocal(data) - } + + // Call provider function with context and optional callback after DOM is fully updated + this.$nextTick(function(){ + const data = this.items(this.context, this._providerSetLocal) + if (data && data.then && typeof data.then === 'function') { + // Provider returned Promise + data.then(items => { + this._providerSetLocal(items) + }) + } else { + // Provider returned Array data + this._providerSetLocal(data) + } + }) }, getTdValues (item, key, tdValue, defValue) { const parent = this.$parent From 4d46e5a6f4ae4ff23192b0061201e9004f9a03a6 Mon Sep 17 00:00:00 2001 From: hlukasik <36456515+henryklukasik@users.noreply.github.com> Date: Fri, 20 Jul 2018 16:48:46 -0400 Subject: [PATCH 2/2] fixing lint error. --- src/components/table/table.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/table/table.js b/src/components/table/table.js index c45ffb6ca57..219315777af 100644 --- a/src/components/table/table.js +++ b/src/components/table/table.js @@ -997,7 +997,7 @@ export default { this.localBusy = true // Call provider function with context and optional callback after DOM is fully updated - this.$nextTick(function(){ + this.$nextTick(function () { const data = this.items(this.context, this._providerSetLocal) if (data && data.then && typeof data.then === 'function') { // Provider returned Promise