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

Collapsed row height with no pagination #69

Closed
ajirnyi opened this issue Aug 20, 2020 · 2 comments
Closed

Collapsed row height with no pagination #69

ajirnyi opened this issue Aug 20, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@ajirnyi
Copy link

ajirnyi commented Aug 20, 2020

In the Shiny demo (as well as in my code), when Pagination is disabled, and Grouping by Species is enabled, the collapsed rows have very large height. Is there any workaround for this?

@ajirnyi
Copy link
Author

ajirnyi commented Aug 21, 2020

FWIW this appears to be related to "height=500" setting in that demo.

@glin
Copy link
Owner

glin commented Aug 23, 2020

Hi, thanks for the report. This is now fixed in the development version (d53a2ba).

The issue was that before, the table rows would stretch to fill the vertical space if there was more space than necessary. This was awkward if the table had a fixed height, but not enough rows to fill out that height:

reactable(
  MASS::Cars93[1:4, 1:4],
  defaultColDef = colDef(footer = "footer"),
  height = 300,
  outlined = TRUE
)

reactable with stretched rows

Now, the table rows won't stretch, which looks less awkward in most cases:
reactable without stretched rows

I think the row stretching was originally intended behavior, so here's a way to restore that if necessary. Use a theme like reactableTheme(tableBodyStyle = list(flex = "auto")):

reactable(
  MASS::Cars93[1:4, 1:4],
  defaultColDef = colDef(footer = "footer"),
  height = 300,
  outlined = TRUE,
  theme = reactableTheme(tableBodyStyle = list(flex = "auto"))
)

@glin glin closed this as completed Aug 23, 2020
@glin glin added the bug Something isn't working label Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants