Consider the following:
ui.R:
library(shiny)
shinyUI(fluidPage(
shinyjs::useShinyjs(),
checkboxGroupInput("Check1",label=h4 ("Fish:"), choices = c("Bass","Shark","Tuna")),
conditionalPanel(condition = "input.Check1 == 'Bass'",
checkboxGroupInput("Check2",label=h4 ("Bass Types:"), choices = c("A","B","C"))
)
))
server.R:
library(shiny)
shinyServer(function(input, output) {
})
When Bass is checked, the new checkbox appears. Great.
But, if I were to select Shark as well, the Bass Types checkbox group disappears.
I would like to keep the Bass Types checkbox there as long as Bass is selected (so it should remain visible if Shark is selected).
I have already tried condition = "'Bass' %in% input.Check1"
.