shiny icon indicating copy to clipboard operation
shiny copied to clipboard

Parent container created by `shiny::tabPanel()` not taking full vertical container space

Open rempsyc opened this issue 1 year ago • 0 comments

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
```

image

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))
```

image

Same with DT tables:

---
output: flexdashboard::flex_dashboard
---

```{r}
shiny::tabsetPanel(shiny::tabPanel("Tab 1", DT::datatable(mtcars)))
```

image

rempsyc avatar May 09 '24 18:05 rempsyc