shiny
shiny copied to clipboard
Parent container created by `shiny::tabPanel()` not taking full vertical container space
Follow-up on plotly/plotly.R#2350
It seems that the parent container created by shiny::tabPanel() is not taking up the full vertical screen space. This creates problems for dynamic sizing with plotly plots or DT tables.
Here is a reprex. The example below works as expected, and ggplotly takes the full vertical space:
---
output: flexdashboard::flex_dashboard
---
```{r}
x <- ggplot2::qplot(mtcars$mpg, mtcars$disp)
p <- plotly::ggplotly(tooltip = c("x", "y"))
p
```
However, ggplotly does not take the full vertical space when inside shiny::tabPanel():
---
output: flexdashboard::flex_dashboard
---
```{r}
x <- ggplot2::qplot(mtcars$mpg, mtcars$disp)
p <- plotly::ggplotly(tooltip = c("x", "y"))
shiny::tabsetPanel(shiny::tabPanel("Tab 1", p))
```
Same with DT tables:
---
output: flexdashboard::flex_dashboard
---
```{r}
shiny::tabsetPanel(shiny::tabPanel("Tab 1", DT::datatable(mtcars)))
```