-
Notifications
You must be signed in to change notification settings - Fork 302
Open
Description
I have a simple table that is rendered correctly as a Shiny app, but becomes broken when embedded into flexdashboard.
Here is what it looks like as a native Shiny app:
But this happens when its embedded into flexdashboard:
This bug is easy to reproduce. The following native Shiny app code is put into bug_test.R:
library(DT)
library(shiny)
ui_test <- fluidPage(
sidebarLayout(
sidebarPanel(),
mainPanel(
DT::dataTableOutput("table"),
)
)
)
server_test <- function(input, output) {
output$table <- DT::renderDataTable(DT::datatable({
colA <- c("A", "B", "C")
colB <- c("X", "Y", "Z")
colC <- c("1", "2", "3")
return(data.frame(colA, colB, colC))
}), options = list(
dom = "t",
ordering = FALSE,
autoWidth = TRUE,
columnDefs = list(
list(className = "dt-right", targets = 1),
list(width = "150px", targets = 0),
list(width = "200px", targets = 1),
list(width = "100px", targets = 2)
)
), selection = "none", rownames = FALSE, escape = FALSE)
}
shinyApp(ui = ui_test, server = server_test)
The flexdashboard code (test.Rmd) is:
---
title: "Test"
output:
flexdashboard::flex_dashboard:
orientation: rows
vertical_layout: scroll
runtime: shiny
---
Tab Name
=======================================================================
```{r}
source("bug_test.R")
shinyApp(ui = ui_test, server = server_test)
```
I am using the latest version of RStudio (2024.04.2, Build 764), and the latest versions of all modules (Shiny 1.8.1.1, DT 0.33, flexdashboard 0.6.2).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

