R shinyBS tooltip lingers even after it is not supposed to

Minimal reproducible example:

library("shiny")
library("shinyBS")
library("shinyjs")

ui <- fluidPage(
  shinyjs::useShinyjs(),
  shiny::actionButton("btnHide", "Disable"),
  shinyBS::bsTooltip("btnHide", "Disable the div")
)

server <- function(input, output) {
  observeEvent(input$btnHide, {
    shinyjs::disable("btnHide")
  })
}

shinyApp(ui, server)

The problem is that when a button is disabled when the tooltip is shown, the tooltip stays permanently visible even after the mouse is long off the button.

This seems to be a Chrome issue. Tested in Firefox, where it works fine.

How would I go about fixing the issue?

Looks like you can use shinyBS::removeTooltip()

library("shiny")
library("shinyBS")
library("shinyjs")

ui <- fluidPage(
  shinyjs::useShinyjs(),
  shiny::actionButton("btnHide", "Disable"),
  shinyBS::bsTooltip("btnHide", "Disable the div")
)

server <- function(input, output, session) {
  
  observeEvent(input$btnHide, {
    shinyjs::disable("btnHide")
    shinyBS::removeTooltip(session, "btnHide")
  })
}

shinyApp(ui, server)

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.