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

Add ihtml.height for interactive custom widget height #1723

Merged
merged 3 commits into from
Jun 19, 2024

Conversation

olivroy
Copy link
Collaborator

@olivroy olivroy commented Jun 19, 2024

To mitigate #1544, specifying manually height could be useful.

Before, there was no way to prevent overflowing with opt_interactive(). Let me know if there is a better way to do this. I tried modifying the height value to NULL, or "auto" in the reactable::reactable() call in render_as_ihtml(), but couldn't find a way to do this well. The only way I found was with manual override. Figure a way to find out the RStudio viewer's size. But after my research, I figured that giving the option to user exactly how to set their widget's height was a good way to go?

I am not too familiar with setting options, and this will likely ignore static options set. I don't know which tab_options() are expected to have an effect in both interactive and non-interactive?

Before:

mtcars %>% gt() %>% opt_interactive()

image

This PR:

mtcars %>% gt() %>% opt_interactive(height = 300)

image

@olivroy olivroy changed the title Add ihtml.height for interactive. Add ihtml.height for interactive custom widget height Jun 19, 2024
@rich-iannone
Copy link
Member

This is actually ideal! There is container_height but it doesn't quite fit, and I think a scoped ihtml.* property is better here.

@rich-iannone rich-iannone self-requested a review June 19, 2024 22:44
Copy link
Member

@rich-iannone rich-iannone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rich-iannone rich-iannone merged commit 0061af8 into rstudio:master Jun 19, 2024
12 checks passed
@olivroy olivroy deleted the interactive branch June 25, 2024 12:21
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

Successfully merging this pull request may close these issues.

2 participants