R 如何取消shinyWidgets radioGroupButtons()中的悬停效果?

标签 r shiny

library(shiny)
library(shinyWidgets)

ui = fluidPage(
  
  tags$style(
    ".btn-info {background-color: #F0F0F0; color: black; border-color:#F0F0F0; text-align: left;}"),

  radioGroupButtons(
    inputId = "Id067",
    choices = c("Yes (Start the survey)",
                "No (End the survey)"),
    direction = "vertical",
    selected = character(0),
    width   = "100%",
    status = 'info',
    size = 'normal',
))

server = function(...) {}

shinyApp(ui, server)

我想取消shinyWidgets radioGroupButtons()中的悬停效果。当我选择一个按钮,然后按住另一个选项按钮,然后在移出该按钮后释放鼠标,这会导致两个按钮都变为蓝色。我认为这个问题与悬停或鼠标悬停有关。这是问题的图像。 enter image description here

最佳答案

您可以在 tags$style 中使用 pointer-event : none 添加 noHover 类 如下

  tags$style(
    ".btn-info.btn {
    background-color: #F0F0F0;
    color: black;
    border-color:#F0F0F0;
    text-align: left;}
    .btn-info.btn:.noHover{
    pointer-events: none;}"
    )

下面是我的屏幕截图(单击后按钮变为蓝色,悬停时没有变化)

screen

关于R 如何取消shinyWidgets radioGroupButtons()中的悬停效果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75841623/

相关文章:

r - 无法用神经网络图生成PDF

r - plotly:通过下拉选择更新数据

r - 将标记数字变量的变量标签转换为新的字符变量

r - 计算所选列值的行数并根据 R 中的计数删除行

r - 带有 Shiny 的多页 intro.js

r - 如何像 Microsoft Excel 表格一样格式化 R Shiny DataTable

r - 全天根据逻辑填写NA

r - 向 selectInput 添加选项

r - 文件上传后 Shiny 的 dplyr 过滤器不起作用

r - 居中 rHandsontable 输出 - Shiny