Skip to content

multiple_radio() with a single choice #427

Description

@MHaringa

Thanks for awesome package. It appears that multiple_radio() returns NULL in case only one choice is defined as argument. See the example below. I would expect that multiple_radio() returns "A" in the following example:

# Checkbox
library(shiny)
library(shiny.semantic)

ui <- function() {
  shinyUI(
    semanticPage(
      h1("Radioboxes"),
      multiple_radio("radioboxes", "Select Letter", LETTERS[1], selected = "A"),
      p("Selected letter:"),
      textOutput("selected_letter")
    )
  )
}

server <- shinyServer(function(input, output) {
  output$selected_letter <- renderText( input$radioboxes )
})

shinyApp(ui = ui(), server = server)

A possible work around is the following, however multiple_radio() returning "A" instead of NULL seems more obvious to me.

server <- shinyServer(function(input, output) {
  output$selected_letter <- renderText( ifelse(is.null( input$radioboxes ),
                                               "A", input$radioboxes))
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions