r - 在可拖动的绝对窗格中向下滚动 selectInput
问题描述
当我运行下面的应用程序时,我无法使用右侧的滚动条向下滚动下拉菜单,因为它会导致下拉菜单立即消失。我只能使用鼠标的滚轮向下滚动。如果我不在可拖动面板中,则问题不存在。
我需要在一个可拖动的面板中,我不希望人们使用我的应用程序对这个向下滚动菜单感到沮丧。
有人知道如何解决这个问题吗?
非常感谢!
我正在使用包 Shiny 的 1.0.5 版本。该问题出现在查看器面板(RStudio 版本 1.1.442、R 版本 3.4.4)和应用程序在 Google Chrome 外部运行时(版本 67.0.3396.99)。
这是应用程序的代码。
library(shiny)
ui <- absolutePanel( id = "controls", class = "panel panel-default", fixed = TRUE,
draggable = TRUE, top = 60, left = "auto", right = 20, bottom = "auto",
width = 500, height = "auto",
uiOutput( 'color' )
)
server <- function( input, output, session ) {
output$color <- renderUI( selectInput( inputId = "color", label = h4( "Variable" ),
selectize = TRUE, choices = LETTERS,
# selectize = TRUE, choices = varLst[[ input$varType ]][[ input$measType ]],
selected = 'A') )
}
shinyApp(ui, server)
解决方案
一个解决方案包括设置draggable=FALSE
和包装包提供的absolutePanel
内部 a ,并带有选项.jqui_draggable
shinyjqui
cancel = ".selectize-control"
library(shiny)
library(shinyjqui)
ui <- jqui_draggable(
absolutePanel( id = "controls", class = "panel panel-default", fixed = FALSE,
draggable = FALSE, top = 60, left = "auto", right = 20,
bottom = "auto", width = 500, height = "auto",
uiOutput( 'color' )
),
options = list(cancel = ".selectize-control"))
推荐阅读
- javascript - 在 Amchart 上的 2 点之间放置 1 小时
- pandas - 两个日期之间的差异会产生不同的结果
- r - 在 MacOS 上查找 R 解释器
- png - 使用 cytoscape 函数 cy.png 导出 PNG 不包含 popper.js 标签
- wordpress - 根据 Wordpress 用户链接
- javascript - 带有 React 组件加载图像的 SharePoint 框架
- autodesk-forge - Autodesk forge 查看器在更新 tls1.2 后出现错误
- .htaccess - 正则表达式 301 重定向 .htaccess 文件
- javascript - 我如何使用 javascript 来控制 DOM 对象的列表
- python - 从导入到 python 的 excel 文件中打印特定列