-
Notifications
You must be signed in to change notification settings - Fork 64
Closed
Description
Do the following in the following to repro the issue:
- Click "Show popover"
- Click "Hide popover"
- Click "Show popover"
- Switch on "Add a popover title"
- Switch off "Add a popover title"
Step 5 should remove the title from popover, but it doesn't. This issue was surfaced after a recent fix in #747 by an existing popover test https://rstudio.github.io/shinycoreci/results/2024/03/15/#316-bslib-popovers-macOS-4.3
library(shiny)
library(bslib)
library(plotly)
ui <- page_sidebar(
title = "Popover tests",
card(
card_header(
popover(
span(
"Card title with popover",
bsicons::bs_icon("question-circle-fill")
),
"Popover message",
id = "popover",
placement = "right"
)
),
plotlyOutput("bars")
),
sidebar = list(
textInput("popover_msg", "Enter a popover message", "Popover message"),
actionButton("show_popover", "Show popover", class = "mb-3"),
actionButton("hide_popover", "Hide popover"),
br(),
input_switch("show_title", "Add a popover title"),
conditionalPanel(
"input.show_title",
textInput("popover_title", "Enter a title", "Popover title"),
)
)
)
server <- function(input, output, session) {
observe({
update_popover(
"popover", input$popover_msg,
title = if (input$show_title) input$popover_title
)
})
observeEvent(input$show_popover, {
toggle_popover("popover", show = TRUE)
})
observeEvent(input$hide_popover, {
toggle_popover("popover", show = FALSE)
})
output$bars <- renderPlotly({
plot_ly(diamonds, x = ~cut)
})
}
shinyApp(ui, server)
Metadata
Metadata
Assignees
Labels
No labels