Skip to content

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

@TymekDev

Description

@TymekDev

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions