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

updateSelectizeInput does not update #130

Open
mmoisse opened this issue Nov 10, 2020 · 0 comments
Open

updateSelectizeInput does not update #130

mmoisse opened this issue Nov 10, 2020 · 0 comments

Comments

@mmoisse
Copy link

mmoisse commented Nov 10, 2020

When using selectizeInput and updateSelectizeInput to update the choices, the update does not appear when using with a material_page.

An example:


shinyApp(
  material_page(fluidPage(
    material_button("add","Add 10"),
    selectizeInput("foo", "Foo", choices = c("a","b")),
    textOutput("text")
  )),
  function(input, output, session) {
    choices <- reactive({
      c("a", "b", (0:(10*as.numeric(input$add))))
    })
    output$text <- renderText({ choices() })
    observe({
      updateSelectizeInput(session, 'foo', choices = choices(), server = TRUE)
    })
  }
)

It gets resolved when adding the selectizeInput from server side


shinyApp(
  material_page(fluidPage(
    material_button("add","Add 10"),
    uiOutput("TT"),
    textOutput("text")
  )),
  function(input, output, session) {
    choices <- reactive({
      c("a", "b", (0:(10*as.numeric(input$add))))
    })
    output$text <- renderText({ choices() })
    output$TT<-renderUI({
      selectizeInput("foo", "Foo", choices = c("a","b"))
    })
    observe({
      updateSelectizeInput(session, 'foo', choices = choices(), server = TRUE)
    })
  }
)
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