fix(table): only call provider once DOM is fully updated (#1904) #1955
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The provider function was called with state values that were only partially updated after a user action as this function is called as soon as an event is emitted. This meant that the provider was called with potentially an invalid context as in the case I encountered and subsequent calls for subsequent data changes from the event processing were ignored as the table was set as busy.
With this change, waiting for the $nextTick before calling the provider, the DOM has time to update and it is called with the proper context. The provider is also only called once per user event as opposed to every state changes stemming from the event if the busy state had been removed; so this is the proper solution considering that the provider may be reaching out a remote database.