Closed LELULAS closed 1 year ago
Hello,
You can make it scrollable by adding some CSS styles directly to the input itself or by placing the widget inside a container like a div
. Here's an example where it set maximal height for the input by adding styles with package {htmltools} :
library(shiny)
library(shinytreeview)
data("world.cities", package = "maps")
choices <- maps::world.cities |>
subset(pop > 1e5) |>
make_tree(c("country.etc", "name"))
ui <- fluidPage(
tags$h3("treeviewInput cities example"),
treeviewInput(
inputId = "tree",
label = "Choose a city:",
choices = choices,
multiple = FALSE
) |> htmltools::tagAppendAttributes(style = "max-height: 600px; overflow: auto;"),
verbatimTextOutput(outputId = "result")
)
server <- function(input, output, session) {
output$result <- renderPrint({
input$tree
})
}
if (interactive())
shinyApp(ui, server)
Thank you!!
My list is very long, especially when certain categories are expanded. Is there some way to make it scrollable?