Skip to content

Binding problem when there is encapsulation within "column( ..., conditionalPanel( ... " #4401

Description

@djacob65

Here is a simple Shiny application

library(shiny)

ui <- fluidPage(
column(9, style = "padding:0px 10px 0px 0px;",
conditionalPanel(
condition = "input.fusrctmax == 0",
selectInput("ctmax", "Maximum contact time :",
choices = c("500","1000","2000","5000","10000"),
selected = "10000")
),
conditionalPanel(
condition = "input.fusrctmax == 1",
numericInput("usrctmax", "Maximum contact time", value = 10000)
)
),
checkboxInput("fusrctmax", "User", FALSE),
verbatimTextOutput("debug")
)

server <- function(input, output, session) {
observeEvent(input$fusrctmax, {
if (input$fusrctmax)
updateNumericInput(session, "usrctmax", value = as.numeric(isolate(input$ctmax)))
else
updateSelectInput(session, "ctmax", selected = isolate(input$usrctmax))
})

output$debug <- renderText({
paste("fusrctmax:", input$fusrctmax,
"| ctmax:", input$ctmax,
"| usrctmax:", input$usrctmax)
})
}

shinyApp(ui, server)

When the checkbox is checked, the numerical input does not allows me to change values !?!

Why ?

Thanks
Daniel

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority: LowLow-impact bug, docs polish, papercut, or unclear low-severity request.ai-triage:doneMarks an issue whose AI triage workflow is complete.needs clarificationMissing a specific expected behavior, environment detail, screenshot, log, or scope decision.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions