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

tableOutput gets stuck with display: none when layout is fitDataTable and data is shiny::req()-ed #63

Open
TymekDev opened this issue Dec 10, 2024 · 1 comment

Comments

@TymekDev
Copy link

I just ran into an issue where the tabulator widget gets permanently stuck with display: none.
This happens when layout is set to fitDataTable and the reactive chain is stopped with shiny::req().

Demo

CleanShot.2024-12-10.at.11.32.43.mp4

Code

library(shiny)
library(rtabulator)


ui <- fluidPage(
  checkboxInput("show", "Show Tables"),
  tableOutput("table"),
  tabulatorOutput("tabulator", height = "fit-content")
)

server <- function(input, output, session) {
  data_ <- reactive({
    req(input$show)
    head(iris, 5)
  })

  output$table <- renderTable({
    data_()
  })

  output$tabulator <- renderTabulator({
    tabulator(
      data_(),
      tabulator_options(
        layout = "fitDataTable"
      )
    )
  })
}

shinyApp(ui, server)
@crazycapivara
Copy link
Contributor

@TymekDev I think, this is unfortunately a bug in the JS package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants