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

FR: Close automatically popover after selectInput is changed #1150

Open
olivroy opened this issue Dec 13, 2024 · 0 comments
Open

FR: Close automatically popover after selectInput is changed #1150

olivroy opened this issue Dec 13, 2024 · 0 comments

Comments

@olivroy
Copy link
Contributor

olivroy commented Dec 13, 2024

ui <- page_fixed(
  card(
    card_header(
      popover(
        uiOutput("region", inline = TRUE),
        title = "Choose a region",

        selectInput("region", label =  "Region", choices = c("USA", "Canada", "France"), selected = "Canada")
      )
    ),
    "The card body..."
  )
)

server <- function(input, output) {
  output$region <- renderUI({
    list(
      paste0("I chose ", input$region),
      bsicons::bs_icon("pencil-square")
    )
  })
}

shinyApp(ui, server)

I derived this from some examples in https://rstudio.github.io/bslib/articles/tooltips-popovers/index.html?q=hide#readupdate-visibility

I wonder if it would be possible to close the popover automatically after selection is made. Currently, only clicking on the X directly can close the popover. For me, ESC doesn't work to close it either.

Image

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