Skip to content

Expand cell retains expandable state even if the nonExpandable array has changed #1377

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

Closed
pastinepolenta opened this issue May 15, 2020 · 2 comments
Assignees

Comments

@pastinepolenta
Copy link

pastinepolenta commented May 15, 2020

Describe the bug
The expand cell retains the old expandable state even if the nonExpandable array has changed.

To Reproduce
Initialize a table with a nonExpandable empty array.
All the rows are expandable, and that is OK.
After the first render, update that nonExpandable array to include some row ids.
At this point, those rows should not be expandable, and they aren't, but the expand cell still looks like it could expand, because the prop expandable remained true.

In the provided codesandbox the rows 1 and 2 should not have the "plus" sign because they are not expandable.

codesandbox
https://codesandbox.io/s/react-bootstrap-table-next-basic-example-007mn?file=/src/index.js

@AllenFang
Copy link
Member

@stilllife00 fixed and please upgrade at least react-bootstrap-table-next to newest, thanks!

@pastinepolenta
Copy link
Author

pastinepolenta commented Oct 9, 2020

@AllenFang I think I can still reproduce the same issue in case of data change rather than nonExpandable change.

This is happening to me when i build up table data from different API feeds, and the API responses come in at different times.
So the table is re-rendered with the new data, but the expandable prop of the expandColumnRenderer function is kept as it was at first render.

I am for now overcoming this by entirely remounting (with key) the table when the data change but this looks like a bug on the library.

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

2 participants