JohnCoene / tippy

💬 Tippy.js for Shiny
http://tippy.john-coene.com/
Other
76 stars 2 forks source link

Set timeout for a click trigger #17

Open u9090 opened 3 years ago

u9090 commented 3 years ago

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)