Skip to content
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

Error when using renderRowExpanded with rowHeight #454

Open
grazielleanna opened this issue Aug 21, 2023 · 1 comment
Open

Error when using renderRowExpanded with rowHeight #454

grazielleanna opened this issue Aug 21, 2023 · 1 comment

Comments

@grazielleanna
Copy link

grazielleanna commented Aug 21, 2023

Versions

package version
react 18.2.0
rsuite-table 5.11.0

What is the expected behavior?

That the component appears correctly when clicking in row to expand.

What is the current behavior?

When clicking on the button to expand the component tha should appear is not shown and it is not possible to click again on the line to hide

What are the steps to reproduce?

Insert rowHeight into the table and have a component on the renderRowExpanded property

Please fork this example, reproduce the problem you are issue.
https://codesandbox.io/s/festive-grothendieck-s9f8cc?file=/src/table.tsx

@simonguo
Copy link
Member

You can determine whether it is an expanded row in rowHeight. If it is an expanded row, return the expanded height, otherwise return the default height.

rowHeight={(rowData) => {
  if (expandedRowKeys.includes(rowData?.first_name)) {
    return 120 + 45;
  }
  return 45;
}}

https://codesandbox.io/s/inspiring-ganguly-g4kddz?file=/src/table.tsx

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