2017-11-24 3 views
0

Kann man einen Tooltip verzögern und nach ein paar Sekunden ablaufen?Verzögerung und Verfall eines shinyBS :: bsTooltip

require(shiny) 
require(shinyBS) 

shinyApp(ui = fluidPage(
    shinyjs::useShinyjs(), 
    bsTooltip(id = 'input', title = "Lets delay this appearing for 1s and force disappear after 5s", 
    placement = "bottom", trigger = "hover", options = list(delay = list(show=1000, hide=3000))), 

    sidebarLayout(
    sidebarPanel(
     selectInput(inputId = 'input', label = 'input', choices = c('cats','dogs')) 
    ), 
    mainPanel() 
) 
) 
, server = function(input, output){}) 

enter image description here

Antwort

1

shinyBS::bsTooltip nicht richtig verschachtelte options Listen in https://github.com/ebailey78/shinyBS/blob/shinyBS3/R/Tooltips_and_Popovers.R#L129

serialisiert Das options Objekt endet aussehen wie { delay: "list(show = 1000, hide = 3000)" }

Leider sieht es so aus shinyBS wird nicht länger gepflegt, oder Ein Update wäre es wert, eingereicht zu werden.

Ich schlage eine Problemumgehung vor - mit shinyBS::addTooltip, die options korrekt serialisiert.

require(shiny) 
require(shinyBS) 

shinyApp(
    ui = fluidPage(
    # shinyjs::useShinyjs(), 
    shinyBS:::shinyBSDep, 

    sidebarLayout(
     sidebarPanel(
     selectInput(inputId = 'input', label = 'input', choices = c('cats','dogs')) 
    ), 
     mainPanel() 
    ) 
), 
    server = function(input, output, session) { 
    addTooltip(session, id = 'input', title = "Lets delay this appearing for 1s and force disappear after 5s", 
       placement = "bottom", trigger = "hover", options = list(delay = list(show=1000, hide=3000))) 
    } 
) 

Oder einfach direkt mit Bootstrap.

+0

Prost Greg das wird den Job machen. – geotheory

Verwandte Themen