ebailey78 / shinyBS

Twitter Bootstrap Components for Shiny
182 stars 47 forks source link

Popover refreshes the app #149

Open mrvictorica opened 1 month ago

mrvictorica commented 1 month ago

Hi there,

I'm working on a Shiny app that includes popover messages on certain input widgets, and I've noticed an issue. When clicking the "i" icon, the information displays briefly but then the app automatically refreshes and returns to the start page.

I've observed the same behavior in the tooltip_popover_modal demo app on the bsplus github.io page, and my code is based on that example.

Here's the relevant code:

library("shiny")
library("shinythemes")
library("bsplus")

# Define UI element
input_letter <-
  selectInput(
    inputId = "letter",
    label = "Label with popover help",
    choices = c("a", "b", "c")
  ) %>%
  shinyInput_label_embed(
    shiny_iconlink() %>%
    bs_embed_popover(
      title = "Letter", content = "Choose a favorite", placement = "left"
    )
  )

# UI
ui <- shinyUI(fluidPage(

   theme = shinytheme("sandstone"),

   # Application title
   titlePanel("Popover demo"),

   # Sidebar with a slider input for number of bins
   sidebarLayout(
      sidebarPanel(
        input_letter
      ),
      mainPanel(
        textOutput("letter")
      )
   ),

   # activate popovers
   use_bs_popover()

))

# Server
server <- shinyServer(function(input, output) {
  output$letter <- renderText(input$letter)
})

Would you mind taking a look? Any help would be appreciated!

Thanks!