shiny.fluent icon indicating copy to clipboard operation
shiny.fluent copied to clipboard

Fix multiselect in ComboBox

Open jakubsob opened this issue 3 years ago • 3 comments

Changes

Closes #160

How to test

library(shiny)
library(shiny.fluent)

shinyApp(
  ui = fluentPage(
    ComboBox.shinyInput(
      inputId = "multiselect",
      multiSelect = TRUE,
      options = list(
        list(key = "A", text = "A"),
        list(key = "B", text = "B"),
        list(key = "C", text = "C")
      )
    ),
    ComboBox.shinyInput(
      inputId = "singleselect",
      multiSelect = FALSE,
      options = list(
        list(key = "A", text = "A"),
        list(key = "B", text = "B"),
        list(key = "C", text = "C")
      )
    )
  ),
  server = function(input, output, session) {

  }
)

jakubsob avatar Feb 27 '23 09:02 jakubsob

Additional test app to also test Dropdown

library(shiny)
library(shiny.fluent)

options <- list(
  list(key = "A", text = "Option A"),
  list(key = "B", text = "Option B"),
  list(key = "C", text = "Option C")
)

ui <- function(id) {
  ns <- NS(id)
  div(
    ComboBox.shinyInput(
      ns("combo"),
      options = options,
      multiSelect = TRUE,
      value = "A"
    ),
    textOutput(ns("comboValue")),
    Dropdown.shinyInput(
      ns("dropdown"),
      value = "A",
      options = options,
      multiSelect = TRUE
    ),
    textOutput(ns("dropdownValue"))
  )
}

server <- function(id) {
  moduleServer(id, function(input, output, session) {
    output$comboValue <- renderText({
      dput(input$combo)
    })
    output$dropdownValue <- renderText({
      input$dropdown
    })
  })
}

jakubsob avatar Apr 24 '23 09:04 jakubsob

Still seeing the issue from #160? Wondering if this has been paused?

erikrenz88 avatar Sep 11 '23 17:09 erikrenz88

@jakubsob Can you replicate this bug? Where it takes the "Option A" as the key starts with "A"

inst/examples/ComboBox.R

Screencast from 2023-11-13 14-01-10.webm

averissimo avatar Nov 13 '23 13:11 averissimo