question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pagination dropdown getting close when setState({ data })

See original GitHub issue

I’m using react-bootstrap-table with remote data and fetching the data every few seconds to update the table.

<BootstrapTable
    remote={ true }
    data={ this.state.data }
    ....

And when fetching the data I use setState({ data }).

If I open the pagination menu - once the component is refreshed with the data from the server - the dropdown is getting closed automatically.

I’m using version 3.0.0

Is there something I can do to keep the pagination dropdown open?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
AllenFangcommented, Mar 18, 2017

sorry for lately reply cause of my busy job…

If I open the pagination menu - once the component is refreshed with the data from the server - the dropdown is getting closed automatically.

yap, it’s not a bug, because a re-render happen via setState

Is there something I can do to keep the pagination dropdown open?

there’s no any good way to achieve easily, but you can custom the dropdown and keep it always open, check this and add a props hidden={ false } on SizePerPageDropDown

Ley me know if you have any questions, thanks

0reactions
AllenFangcommented, Apr 13, 2017

Try v3.1.8, you can get the dropdown DOM via .react-bs-table-sizePerPage-dropdown and register it with DropDown Events

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to clear cache and make another API call based on ...
So whenever I change contentTypeDropdown value the cache should be cleared ... import { AsyncPaginate } from 'react-select-async-paginate';.
Read more >
React setState async cause the delay of dropdown
I was trying to made a dropdown with default value. So, for example, it shows "Year" at the beginning, after clicking user should...
Read more >
How To Build Custom Pagination with React | DigitalOcean
Start a new React application using the create-react-app command. You can name the application whatever you'd like, but this tutorial will name ...
Read more >
Improve the performance of dropdown containing large data ...
In this blog, we will share how the problem was solved using 'Virtualization'. Let's first go through the term 'Virtualization'.
Read more >
How to Implement Infinite Scrolling with React.js | Pluralsight
Here in this guide, we will develop a simple custom infinite scrolling mechanism that helps us to load data based on a scroll...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found