dreamRs / shinyWidgets

shinyWidgets : Extend widgets available in shiny
https://dreamrs.github.io/shinyWidgets/
GNU General Public License v3.0
832 stars 153 forks source link

RadioGroupButtons no longer returning an input value #466

Closed jamessmythe closed 2 months ago

jamessmythe commented 2 years ago

I have re-published an app today and the RadioGroupButtons no longer return an input value in the session. The app is using shinydashboard and shinyWidgets. Restoring shinyWidgets 0.6.2 fixed the problem.

pvictor commented 2 years ago

Thanks for reporting, can you share more informations ? Example below works fine for me. What's your radioGroupButtons configuration ?

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody(

    radioGroupButtons(
      inputId = "somevalue1",
      label = "Choose a value: ",
      choices = c("A", "B", "C")
    ),
    verbatimTextOutput("value1"),

    radioGroupButtons(
      inputId = "somevalue3",
      label = "With icons:",
      choices = names(mtcars),
      status = "primary",
      justified = TRUE,
      checkIcon = list(
        yes = icon("check-square"),
        no = icon("square-o")
      )
    ),
    verbatimTextOutput("value3"),

    checkboxGroupButtons(
      inputId = "somevalue2",
      label = "Make a choice: ",
      choices = c("A", "B", "C")
    ),
    verbatimTextOutput("value2")

  ),
  title = "Dashboard example"
)

server <- function(input, output, session) {
  output$value1 <- renderPrint({ input$somevalue1 })
  output$value2 <- renderPrint({ input$somevalue2 })
  output$value3 <- renderPrint({ input$somevalue3 })
}

shinyApp(ui, server)

Victor

jamessmythe commented 2 years ago

Hi Victor. It's a difficult one as I'm not expert enough on package versions, sorry. Also, it was working OK locally but not once deployed in a docker container, even when I updated all of my local packages. I've attached the dockerfile which compiles the code, switching row 19 for row 20 sorted the issue.

Dockerfile.zip

Does that help?

jamessmythe commented 2 years ago

Hi Victor, I can confirm that this is happening on all our dockerized projects that use the rocker/shiny-verse base image, whenever we update to 0.6.3

pvictor commented 2 years ago

Thanks for your inputs. I will try with a dockerized app using rocker/shiny-verse. Have you been abble to reproduce the issue locally ?

jamessmythe commented 2 years ago

No, it all works well locally.

Thank you James

On 17 Jan 2022, at 16:22, Victor Perrier @.***> wrote:

Thanks for your inputs. I will try with a dockerized app using rocker/shiny-verse. Have you been abble to reproduce the issue locally ?

— Reply to this email directly, view it on GitHub https://github.com/dreamRs/shinyWidgets/issues/466#issuecomment-1014709216, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJX6K3VFYM67T5KIJCMY3K3UWQ643ANCNFSM5L7LH2ZA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.

HansiBansi commented 2 years ago

I have a very similar problem! plot 1 is working while plot 2 with a shinyWidgets for color selection is not. Also started after an update!

x=as.data.frame(Titanic)
str(x)
choice_fac=colnames(x)[1:4]

uix<-fluidPage(
  fluidRow(
      column(colourInput(inputId = "col3",
                             label = "Choose colour 3", 
                             value=  "green"), width=3),
      column(colourInput(inputId = "col4",
                             label = "Choose colour 4", 
                             value=  "blue" ), width=3), 
      column(plotOutput("plot34"), width=4)
          ),

   fluidRow(
   column(colorSelectorInput(inputId = "col1",
                       label = "Choose colour 1", 
                       choices=choice_col,
                       selected=  "green"), width=3),
   column(colorSelectorInput(inputId = "col2",
                       label = "Choose colour 2", 
                       choices=choice_col,
                       selected=  "blue" ), width=3), 
   column(plotOutput("plot12"), width=4)
             ),

    )

  serverx<-function(input, output){

  output$plot12=renderPlot({

    x%>%ggplot()+
      geom_col(aes(x=Sex, y=Freq, fill=Sex))+
      scale_fill_manual(values=c(input$col1, input$col2))

  })

  output$plot34=renderPlot({

    x%>%ggplot()+
      geom_col(aes(x=Sex, y=Freq, fill=Sex))+
      scale_fill_manual(values=c(input$col3, input$col4))

  })

  }

  shinyApp(uix, serverx)

sessionInfo() R version 4.1.2 (2021-11-01) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale: [1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252 [4] LC_NUMERIC=C LC_TIME=German_Germany.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] colourpicker_1.1.1 ggplot2_3.3.5 shinyWidgets_0.6.3 tibble_3.1.6 dplyr_1.0.7 shiny_1.7.1

loaded via a namespace (and not attached): [1] Rcpp_1.0.8 pillar_1.6.5 compiler_4.1.2 bslib_0.3.1 later_1.3.0 jquerylib_0.1.4
[7] tools_4.1.2 digest_0.6.29 gtable_0.3.0 jsonlite_1.7.3 lifecycle_1.0.1 pkgconfig_2.0.3
[13] rlang_1.0.0 rstudioapi_0.13 cli_3.1.1 DBI_1.1.2 fastmap_1.1.0 withr_2.4.3
[19] htmlwidgets_1.5.4 generics_0.1.1 vctrs_0.3.8 sass_0.4.0 grid_4.1.2 tidyselect_1.1.1 [25] glue_1.6.1 R6_2.5.1 fansi_1.0.2 farver_2.1.0 purrr_0.3.4 magrittr_2.0.2
[31] scales_1.1.1 promises_1.2.0.1 ellipsis_0.3.2 htmltools_0.5.2 rsconnect_0.8.24 assertthat_0.2.1 [37] colorspace_2.0-2 mime_0.12 xtable_1.8-4 httpuv_1.6.5 labeling_0.4.2 utf8_1.2.2
[43] miniUI_0.1.1.1 munsell_0.5.0 cachem_1.0.6 crayon_1.4.2

pvictor commented 2 years ago

@HansiBansi thanks for reporting, unrelated to original issue but issue nonetheless. If you re-install from GitHub it should be OK.