Skip to content

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

@john-harrold

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)

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