0

Btable freezes some times while filtring.

enter image description here

You can see the time difference where it freezes , this makes whole browser get hang or stuck

My Code

<b-form-input v-model="filter" placeholder="Search files..." @keyup.native.esc="filter = ''"/>
<span v-if="filter" class="icon-clear" @click="filter = ''"></span>

<b-table show-empty striped outlined responsive hover no-sort-reset
             ref="table"
             empty-text="No files found"
             :items="items"
             :fields="fields"
             :filter="filter"
             :sort-by.sync="sort.field"
             :sort-desc.sync="sort.descending"
             :sort-direction="sort.direction"
             :current-page.sync="pagination.page"
             :per-page="pagination.size"
             @sort-changed="pagination.page=0"
             @filtered="onFiltered">

Why it is hapenning and how should i resolve this hanging issue

Sunil Kumar
  • 1,349
  • 3
  • 14
  • 25
  • How many items are you showing per page? – Hiws May 06 '20 at 15:00
  • it is not much it is 10 items per page – Sunil Kumar May 06 '20 at 15:02
  • That's not a lot. That shouldn't be causing that many issues. How many fields, and total rows do you have? Also, which version of `Bootstrap-Vue` are you using? – Hiws May 06 '20 at 15:03
  • You might also want to add a debounce to your input via the `debounce` prop. Right now the table is trying to rerender on each keystroke. – Hiws May 06 '20 at 15:04
  • total item is just 50 that is not much can you please help me to understand why table is trying to rerender on each keystroke? – Sunil Kumar May 06 '20 at 15:09
  • It re-renders because the `filter` prop on the table changes. You write the character `A`, so the table sees that and starts filtering immediately for rows container the letter `A`. You then type the letter `B`, so now the `filter` changed again to `AB` and it starts all over again. – Hiws May 06 '20 at 15:10
  • However, with just 50 rows, and 10 per page. There shouldn't be any issues even without a debounce. I think there's more going on that just the table. Are you on the latest version? – Hiws May 06 '20 at 15:12
  • currently i am using 2.6.1 – Sunil Kumar May 06 '20 at 15:19
  • I believe there's been table optimizations after that. Try upgrading to the latest version. – Hiws May 06 '20 at 15:40
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/213263/discussion-between-sunil-kumar-and-hiws). – Sunil Kumar May 06 '20 at 19:13

0 Answers0