【问题标题】:R Shiny - customisation options not working for tippy::with_tippy()R Shiny - 自定义选项不适用于tippy::with_tippy()
【发布时间】:2020-03-05 23:13:02
【问题描述】:

我正在尝试使用 tippy 包将工具提示定位到 textInput 的右侧,但是它不起作用:

library(shiny)
library(tippy)

shinyApp(
  ui = fluidPage(
    with_tippy(textInput("input", "input with tooltip"), "Input text", placement = "right")
 ),
 server = function(input, output) {}
)

position = 'right'arrow = 'true'theme = 'light' 选项似乎也不起作用。

我想知道这是浏览器兼容性问题,还是我缺少一些 CSS 依赖项?我曾尝试在Chrome v82.0.4068.5Firefox 73.0.1Microsoft Edge 44.18362.449.0 上运行该应用程序,但无济于事。

【问题讨论】:

    标签: r shiny tippyjs


    【解决方案1】:

    您的代码无法运行,因为with_tippy 不是有效函数。

    以下代码应正确显示工具提示的位置。 需要注意的重要一点:为了清楚起见,tippy_this(elementId) 在此处引用了名为 THISinputtextInput(inputId)

    我们没有将textInput 实际包装在tippy_this 中,而是使用elementId 引用输入。

    library(shiny)
    library(tippy)
    
    shinyApp(
      ui = fluidPage(
        textInput(inputId = "THISinput", "input with tooltip"),
        tippy_this(elementId = "THISinput", tooltip = "Hovertext for 'THISinput' here", placement="right")
      ),
      server = function(input, output) {}
    )
    

    【讨论】:

    猜你喜欢
    • 2019-07-22
    • 1970-01-01
    • 1970-01-01
    • 2017-12-09
    • 2017-12-18
    • 1970-01-01
    • 2013-04-22
    • 1970-01-01
    • 2019-07-07
    相关资源
    最近更新 更多