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

buttonInput has different result than actionButton in trigger of modal inputs #202

Open
zross opened this issue Oct 13, 2022 · 1 comment

Comments

@zross
Copy link
Contributor

zross commented Oct 13, 2022

There may be a reason for this (?) but it seems odd that if I use actionButton the select in the modal is triggered the way I would expect but if I use buttonInput none of the changes to the select are triggered.

cc @phoward38

library(shiny)

ui <- fluidPage(
  actionButton('a', "Click me")
  #yonder::buttonInput('a', "Click me")
)

server <- function(input, output, session) {
  
  ns <- NS("dc")
  
  sel <- reactiveVal('b')

  observeEvent(input$a, {
    shiny::showModal(
      shiny::modalDialog(
        shiny::selectInput(
          inputId = 'abc',
          'label',
          choices = c("a", "b", "c"),
          selected = sel()
        )
      )
    )

  })
  
  observeEvent(input$abc, {
    message(input$abc)
    sel(input$abc)
  })
  
}

shinyApp(ui, server)
@nteetor
Copy link
Owner

nteetor commented Oct 31, 2024

Using the example provided above I didn't notice any difference in behaviour changing between the yonder button and the shiny action button.

Using the yonder button, the modal wasn't opening up? Only the select input wasn't updated?

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

2 participants