I want to add tooltips to my action buttons or my sliders with the package shinyBS
and a function tipify
.
I added a text for the "title" argument of the tooltip. However, when my text has an apostrophe (single quote), it gives an error.
Which does not happen with the label of the actionButton itself!
library(shiny); library(shinyBS)
shinyApp(ui = basicPage(p("title"), uiOutput("button_with_tooltip"), uiOutput("input_slider")),
server = function(input, output, session){
output$button_with_tooltip = renderUI({
tipify(actionButton("button", label="I'm doing nothing"), title="I am doing nothing")})})
If you change the tooltip title from "I am" to "I'm", it won't display.
And even more surprising behaviour consequence of this error is with inputSlider
, they transform themselves automatically into a numericInput
when the title of the tooltip has a single quote in it... weird! Try this:
shinyApp(
ui = basicPage(p("title"), uiOutput("input_slider")),
server = function(input, output, session){
output$input_slider = renderUI({
tipify(sliderInput("slider", label="I'm a simple slider", min=0, max=10, value=5), title="I'm doing nothing")
})})
Why does this happen and how can I override this? Thanks,
NB: I'm French so I do NEED apostrophes
Thanks,