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

Include the required files for virtualSelect tooltips #673

Closed
stla opened this issue Mar 8, 2024 · 0 comments
Closed

Include the required files for virtualSelect tooltips #673

stla opened this issue Mar 8, 2024 · 0 comments

Comments

@stla
Copy link
Contributor

stla commented Mar 8, 2024

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)
@pvictor pvictor closed this as completed in 4300578 Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant