-
Notifications
You must be signed in to change notification settings - Fork 775
Pagination dropdown getting close when setState({ data }) #1153
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
Comments
sorry for lately reply cause of my busy job...
yap, it's not a bug, because a re-render happen via setState
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 Ley me know if you have any questions, thanks |
Thanks for the fast reply @AllenFang! What do you think? I can add a PR for this one, will you merge it? |
I can try to add this, so is that helpful for you? I think a return bool value can perform the dropdown open/close maybe is what you want. |
My thinking was that I can stop the refreshing from the server while the dropdown is open, and when the dropdown is closed I will renew the requests. This way - the component will not re-render while the dropdown is open (because there will be no new requests). |
sorry, I got misunderstand, for your mentioned before, I will try to support a callback on dropdown for open/close, thanks |
Do you prefer that I provide a PR for that? |
@dekelb, I think I can handle it, take your time :) |
@dekelb, I've try to implement but I found some situation here. Firstly, bootstrap dropdown can be close via clicking the outside of dropdown itself, so if you want to know the dropdown close by this way, you need to use so my recommendation is you can know it open/close via native bootstrap event, like the above reference but you need to know the DOM id or class, so I'll add a general class name on dropdown for you can get the DOM via |
Try |
I'm using react-bootstrap-table with remote data and fetching the data every few seconds to update the table.
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?
The text was updated successfully, but these errors were encountered: