Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

radiobarInput not triggering observe (selectInput is fine) #200

Open
zross opened this issue Sep 14, 2022 · 0 comments
Open

radiobarInput not triggering observe (selectInput is fine) #200

zross opened this issue Sep 14, 2022 · 0 comments

Comments

@zross
Copy link
Contributor

zross commented Sep 14, 2022

@nteetor I'm finding that the radiobarInput is not triggering an observe in the way I would expect. In the minimal example below, when you click on the button you'll see that the change to the select input is registered but not the change to the radiobar. The yonder::selectInput and the shiny::selectInput both work fine.

Any ideas why this might be?

library(shiny)
library(yonder)

ui <- fluidPage(
 
  list(
    yonder::radiobarInput(
      id = "yonder",
      label = "Yonder input",
      choices = c("a", "b", "c"),
      values = c("a", "b", "c"),
      selected = "b"
    ),
    shiny::selectInput(
      inputId = "shiny",
      label = "Shiny input",
      choices = c("x", "y", "z"),
      selected = "y"
    ),
    shiny::actionButton("button", "Click me!")
  )

)

server <- function(input, output, session) {
 
  observeEvent(input$button, {
    yonder::updateRadiobarInput(
      id = "yonder",
      selected = "c"
    )
   
    shiny::updateSelectInput(
      inputId = "shiny",
      selected = "z"
    )
  }, ignoreInit = TRUE)
 
  observeEvent(input$yonder, {
    message("radio updated to value ", input$yonder)
  }, ignoreInit = TRUE)
 
  observeEvent(input$shiny, {
    message("select updated ", input$shiny)
  }, ignoreInit = TRUE)
 
}

shinyApp(ui, server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant