Skip to content

fix(table): only call provider once DOM is fully updated (#1904) #1955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 23, 2018

Conversation

henryklukasik
Copy link
Contributor

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.

@codecov
Copy link

codecov bot commented Jul 20, 2018

Codecov Report

Merging #1955 into dev will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #1955      +/-   ##
==========================================
+ Coverage   61.24%   61.26%   +0.01%     
==========================================
  Files         154      154              
  Lines        2885     2886       +1     
  Branches      796      796              
==========================================
+ Hits         1767     1768       +1     
  Misses        802      802              
  Partials      316      316
Impacted Files Coverage Δ
src/components/table/table.js 76.45% <100%> (+0.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9ab23ef...4d46e5a. Read the comment docs.

@mosinve mosinve merged commit ae7147e into bootstrap-vue:dev Jul 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants