tippy icon indicating copy to clipboard operation
tippy copied to clipboard

Set timeout for a click trigger

Open u9090 opened this issue 3 years ago • 0 comments

The following works well with tippy.js, but I do not see how to insert a timeout function in tippy_this.

tippy('#button', {
  trigger: 'click',
  hideOnClick: false,
  onShow(instance) {
    setTimeout(() => {
      instance.hide();
    }, 2000);
  }
});
library(shiny)
library(tippy)

ui <- fluidPage(
  shiny::actionButton("action", "CLick here"),
  
  tippy_this("action",
             tooltip = "This is a tooltip",
             hideOnClick = F,
             placement = 'bottom',
             trigger = 'click',
             duration = 1000
  )
)

server <- function(input, output, session) {
  
}

shinyApp(ui, server)

u9090 avatar Aug 26 '21 10:08 u9090