Open leungi opened 4 years ago
Hey @leungi did you solve this?
If anyone runs into this problem I found a workaround with divs:
tags$div(
title = "This title will be the tooltip, write whatever you want",
shinyWidgets::switchInput(inputId = "somevalue",
value = TRUE,
onLabel = "Yes",
offLabel = "No")
)
@svalvaro I'm not sure I follow your response. Are you saying that the title of tags$div
will be the text of the tooltip. Where is bsTooltip
in your solution?
@latlio Exactly, the title will be the tooltip.
That's the good thing, you don't need bsTooltip
. I came out with this solution since bsTooltip
was not working for me. I hope it helps.
Thanks @svalvaro! For documentation on this thread, the behavior behind @svalvaro's solution is the global HTML title attribute. Note that the time it takes between mouse hover and appearance of tooltip will be browser-dependent, unlike the "instantaneous" response of bsTooltip
. It's still unclear why bsTooltip()
is not working.
A better solution is to assign an ID
to the div
, and call that ID
in the bsTooltip()
This is the "instantaneous" response of bsTooltip
you are looking for.
tags$div(
shinyWidgets::switchInput(inputId = "somevalue",
value = TRUE,
onLabel = "Yes",
offLabel = "No")
, id= "somevalue_div")
bsTooltip(id = "somevalue_div",
title = "Your bubble text title",
placement = "top")
Reprex below.
Changing the
trigger
args inbsTooltip()
doesn't solve it.