Skip to content

Different tooltip behavior with htmlOutput()/renderUI() #110

Description

@john-harrold

In the example below I'm creating two selection boxes. One by putting selectInput() in the ui and another by creating it in the server using htmlOutput()/renderUI(). For me the formatting of the tooltip is different. Is there a way to get the selection generated in the server to behave like that generated in the ui?

Server generated tooltip:

image

UI generated tooltip:

image

library(shiny)
library(bsplus)

ui <- fluidPage(
  use_bs_tooltip(),
  use_bs_popover(),

  titlePanel("Hello Shiny!"),
  sidebarLayout(
    sidebarPanel(
      htmlOutput("serverstuff"),
      selectInput(inputId ="myid_inui",
                  label = "list",
                  choices = c("a", "b", "c", "d"),
                  selected = "a") %>%
        bs_embed_tooltip(title =  "in UI",
                         trigger = "hover")
    ),
    mainPanel(
    )
  )
)
server <- function(input, output) {

  output$serverstuff = renderUI({

    ui_pipe =
      selectInput(inputId ="myid_inserver",
                  label = "list",
                  choices = c("a", "b", "c", "d"),
                  selected = "a") %>%
        bs_embed_tooltip(title =  "htmlOutput()/renderUI()",
                         trigger = "hover")

  ui_pipe})
}
shinyApp(ui, server)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions