Skip to content
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

Page 0 when filtering #82

Open
travisthomson opened this issue Apr 3, 2018 · 6 comments
Open

Page 0 when filtering #82

travisthomson opened this issue Apr 3, 2018 · 6 comments

Comments

@travisthomson
Copy link

When the pagination is based off a filtered array, if the filter ever becomes empty, it auto-selects page "0". When the list is re-populated, you remain on page "0" with no results until you click another page.

@mornir
Copy link

mornir commented Apr 9, 2018

I ran into that problem too. What I did is: wrap vue-paginate in a div with a v-if="yourArray.length". In this way, it will force vue-paginate to re-render.

@mehdirochdi
Copy link

i have a some problem, when i select a value for example in listbox i get empty list but when i select all list a get empty too.

@Organizm238
Copy link

Organizm238 commented Jul 13, 2018

I ran into that problem too. What I did is: wrap vue-paginate in a div with a v-if="yourArray.length". In this way, it will force vue-paginate to re-render.

I think, this should be a part of official doc. Worked like a charm.

@taivu
Copy link

taivu commented Mar 21, 2019

i feel like the solution @mornir has is good work around, but isnt addressing the actual problem. is this an issue with vue's reactivity of the array?

@xlcrr
Copy link

xlcrr commented Oct 29, 2019

Works perfectly! Should be included in the docs.

<div v-if="this.filteredItems.length">
  <paginate>
    <table />
  </paginate>

   <paginate-links />
</div>
<div v-else></div>

@adriangordon1231
Copy link

adriangordon1231 commented Nov 13, 2019

Also works if you add a "v-if" directive to the paginate component itself.

<paginate v-if="this.filteredItems.length"></paginate>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants