Skip to content

Commit

Permalink
Fixes #71 by checking the selector for actual changes (#383)
Browse files Browse the repository at this point in the history
* Fixes #71 by checking the selector for actual changes
Before the selector was always being set which had the effect of 'resetting' the pagination back to zero if the selector was reactively set

* Make sure selector actually exists before trying to compare it
Was causing an issue when it was undefined (i.e.: you switched routes)
  • Loading branch information
Steve Ross authored and Jonathan Davila committed Sep 10, 2017
1 parent 29e8e80 commit fee00fc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@ Template.tabular.onRendered(function () {
var data = Template.currentData();

//console.log('currentData autorun', data);

if (!data) return;

// if we don't have data OR the selector didn't actually change return out
if (!data || (data.selector && template.tabular.selector === data.selector)) return;

// We get the current TabularTable instance, and cache it on the
// template instance for access elsewhere
Expand Down

0 comments on commit fee00fc

Please sign in to comment.