dreamRs / shinyWidgets

shinyWidgets : Extend widgets available in shiny
https://dreamrs.github.io/shinyWidgets/
GNU General Public License v3.0
833 stars 153 forks source link

Include the required files for virtualSelect tooltips #673

Closed stla closed 8 months ago

stla commented 8 months ago

Hello,

I've seen you upgraded virtual-select yesterday. This version allows to have tooltips for options displaying the text ellipsis, but in order to get these tooltips, there are two required files, namely tooltip.min.js and tooltip.min.css, that can be downloaded from here. Then the tooltips appear if one sets the option showValueAsTags=TRUE.

library(shiny)
library(shinyWidgets)

options <- c(
  "This is short text",
  "This is a longer text",
  "This is a very very very very long text",
  "This is a super ultra pro max very very very very long text"
)

ui <- fluidPage(
  tags$head(
    tags$scrip(src = "tooltip.min.js"),
    tags$link(rel = "stylesheet", href = "tooltip.min.css")
  ),
  titlePanel("Virtual Select Input Example"),

  virtualSelectInput(
    "selected_option", "Select Digital Thread:", choices = options,
    multiple = TRUE,
    showValueAsTags = TRUE),

  textOutput("selected_value")
)

server <- function(input, output, session) {
  output$selected_value <- renderText({
    paste("You selected:", input$selected_option)
  })
}

shinyApp(ui, server)