-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Describe the bug
When defining a cell that contains a button with:
<button onClick={row.getToggleExpandedHandler()}>
{row.getIsExpanded() ? "collapse" : "expand"}
</button>the handler does not change the expanded status.
If we instead do:
<button onClick={() => row.toggleExpanded()}>
{row.getIsExpanded() ? "collapse" : "expand"}
</button>the expanded status is correctly updated.
If I try the same this with row.getToggleSelectedHandler(), it works as expected when trying to update selected status.
Your minimal, reproducible example
https://stackblitz.com/edit/stackblitz-starters-fndwe1?file=src%2FApp.tsx
Steps to reproduce
- Click on the row's "expand" button. Row will not be expanded.
Expected behavior
Assigning row.getToggleExpandedHandler() to the onClick attribute of a button should make that button handle expanded state.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
macOS: firefox, edge
fedora: firefox, edge
react-table version
V8.9.3
TypeScript version
No response
Additional context
No response
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels