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()中的悬停效果。当我选择一个按钮,然后按住另一个选项按钮,然后在移出该按钮后释放鼠标,这会导致两个按钮都变为蓝色。我认为这个问题与悬停或鼠标悬停有关。这是问题的图像。
最佳答案
您可以在 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;}"
)
下面是我的屏幕截图(单击后按钮变为蓝色,悬停时没有变化)
关于R 如何取消shinyWidgets radioGroupButtons()中的悬停效果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75841623/