tippy icon indicating copy to clipboard operation
tippy copied to clipboard

Tippy and insertUI

Open bartekch opened this issue 3 years ago • 0 comments

I want to create an actionButton with tippy inside insertUI, unfortunately I can't get it working. I've tried the following approaches, without success.

library(shiny)
library(tippy)
shinyApp(
  ui = basicPage(
    actionButton("add", "Add ui")
  ),
  
  server = function(input, output) {
    observeEvent(input$add, {
      insertUI(
        "#add",
        "afterEnd",
        tagList(
          tippy::tippy(
            actionButton("button1", "tippy"),
            "Tooltip 1"
          ),
          actionButton("button2", "tippyThis"),
          tippy::tippyThis("button2", "Tooltip 2")
        )
      )
    })
  }
)

This was tested with version 1.0.0.

In CRAN version 0.0.1 both approaches (their corresponsing versions) seem to work.

library(shiny)
library(tippy)
shinyApp(
  ui = basicPage(
    actionButton("add", "Add ui")
  ),
  
  server = function(input, output) {
    observeEvent(input$add, {
      insertUI(
        "#add",
        "afterEnd",
        tagList(
          tippy::with_tippy(
            actionButton("button1", "with_tippy working"),
            "Tooltip 1"
          ),
          actionButton("button2", "tippy_this not working"),
          tippy::tippy_this("button2", "Tooltip 2")
        )
      )
    })
  }
)

Is it possible to add tooltips to elements created by insertUI using tippy 1.0.0?

bartekch avatar Feb 25 '22 16:02 bartekch