rstudio / bslib

Tools for theming Shiny and R Markdown via Bootstrap 3, 4, or 5.
https://rstudio.github.io/bslib/
Other
472 stars 57 forks source link

SelectInput appearance altered in sidebar when multiple is TRUE #1070

Closed Huh closed 4 months ago

Huh commented 4 months ago

The appearance of selectInput is altered in sidebars when multiple is TRUE on bslib 0.7.0.

The following renders as expected:

bslib::card(
  bslib::layout_sidebar(
    sidebar  = bslib::sidebar(
        shiny::selectInput(
          "test",
          "Label",
          choices = c("F", "M"),
          multiple = FALSE,
          selectize = TRUE
        )
      ),
      "Main Content"
  )
)

Screenshot 2024-06-04 at 3 33 13 PM

However, when multiple is TRUE all of the options are shown at once

bslib::card(
  bslib::layout_sidebar(
    sidebar  = bslib::sidebar(
      shiny::selectInput(
        "test",
        "Label",
        choices = c("F", "M"),
        multiple = TRUE
      )
    ),
    "Main Content"
  )
)

Screenshot 2024-06-04 at 3 33 57 PM

I am experiencing this on a Mac using Safari and within the RStudio viewer.

Session Info


> devtools::session_info()
─ Session info ────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.4.0 (2024-04-24)
 os       macOS Sonoma 14.5
 system   aarch64, darwin20
 ui       RStudio
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/Denver
 date     2024-06-04
 rstudio  2023.09.0+463 Desert Sunflower (desktop)
 pandoc   NA

─ Packages ────────────────────────────────────────────────────────────────────────────────────────────────────────
 package     * version date (UTC) lib source
 bsicons       0.1.2   2023-11-04 [1] RSPM (R 4.4.0)
 bslib         0.7.0   2024-03-29 [1] RSPM (R 4.4.0)
 cachem        1.0.8   2023-05-01 [1] RSPM (R 4.4.0)
 cli           3.6.2   2023-12-11 [1] RSPM (R 4.4.0)
 devtools      2.4.5   2022-10-11 [1] RSPM (R 4.4.0)
 digest        0.6.35  2024-03-11 [1] RSPM (R 4.4.0)
 ellipsis      0.3.2   2021-04-29 [1] RSPM (R 4.4.0)
 fansi         1.0.6   2023-12-08 [1] RSPM (R 4.4.0)
 fastmap       1.1.1   2023-02-24 [1] RSPM (R 4.4.0)
 fs            1.6.4   2024-04-25 [1] RSPM (R 4.4.0)
 glue          1.7.0   2024-01-09 [1] RSPM (R 4.4.0)
 htmltools     0.5.8.1 2024-04-04 [1] RSPM (R 4.4.0)
 htmlwidgets   1.6.4   2023-12-06 [1] RSPM (R 4.4.0)
 httpuv        1.6.15  2024-03-26 [1] RSPM (R 4.4.0)
 jquerylib     0.1.4   2021-04-26 [1] RSPM (R 4.4.0)
 jsonlite      1.8.8   2023-12-04 [1] RSPM (R 4.4.0)
 knitr         1.46    2024-04-06 [1] RSPM (R 4.4.0)
 later         1.3.2   2023-12-06 [1] RSPM (R 4.4.0)
 lifecycle     1.0.4   2023-11-07 [1] RSPM (R 4.4.0)
 magrittr      2.0.3   2022-03-30 [1] RSPM (R 4.4.0)
 memoise       2.0.1   2021-11-26 [1] RSPM (R 4.4.0)
 mime          0.12    2021-09-28 [1] RSPM (R 4.4.0)
 miniUI        0.1.1.1 2018-05-18 [1] RSPM (R 4.4.0)
 pillar        1.9.0   2023-03-22 [1] RSPM (R 4.4.0)
 pkgbuild      1.4.4   2024-03-17 [1] RSPM (R 4.4.0)
 pkgconfig     2.0.3   2019-09-22 [1] RSPM (R 4.4.0)
 pkgload       1.3.4   2024-01-16 [1] RSPM (R 4.4.0)
 profvis       0.3.8   2023-05-02 [1] RSPM (R 4.4.0)
 promises      1.3.0   2024-04-05 [1] RSPM (R 4.4.0)
 purrr         1.0.2   2023-08-10 [1] RSPM (R 4.4.0)
 R6            2.5.1   2021-08-19 [1] RSPM (R 4.4.0)
 Rcpp          1.0.12  2024-01-09 [1] RSPM (R 4.4.0)
 remotes       2.5.0   2024-03-17 [1] RSPM (R 4.4.0)
 rlang         1.1.3   2024-01-10 [1] RSPM (R 4.4.0)
 rstudioapi    0.16.0  2024-03-24 [1] RSPM (R 4.4.0)
 sass          0.4.9   2024-03-15 [1] RSPM (R 4.4.0)
 sessioninfo   1.2.2   2021-12-06 [1] RSPM (R 4.4.0)
 shiny         1.8.1.1 2024-04-02 [1] RSPM (R 4.4.0)
 stringi       1.8.3   2023-12-11 [1] RSPM (R 4.4.0)
 stringr       1.5.1   2023-11-14 [1] RSPM (R 4.4.0)
 tibble        3.2.1   2023-03-20 [1] RSPM (R 4.4.0)
 urlchecker    1.0.1   2021-11-30 [1] RSPM (R 4.4.0)
 usethis       2.2.3   2024-02-19 [1] RSPM (R 4.4.0)
 utf8          1.2.4   2023-10-22 [1] RSPM (R 4.4.0)
 vctrs         0.6.5   2023-12-01 [1] RSPM (R 4.4.0)
 xfun          0.43    2024-03-25 [1] RSPM (R 4.4.0)
 xtable        1.8-4   2019-04-21 [1] RSPM (R 4.4.0)

 [1] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Huh commented 4 months ago

Following up. I believe these are all preview issues and they work as expected in a shiny app, but do not outside of an application. The following are all of the widgets from the Posit gallery that render differently outside a shiny app.

I am closing.

bslib::card(
  dateInput(
    "date", 
    label = h3("Date input"), 
    value = "2014-01-01"
  ),
  dateRangeInput(
    "dates", 
    label = h3("Date range")
  ),
  selectInput(
    "select", 
    label = h3("Select box"), 
    choices = list(
      "Choice 1" = 1, 
      "Choice 2" = 2,
      "Choice 3" = 3
    ), 
    multiple = TRUE
  ),
  sliderInput(
    "slider1", 
    label = h3("Slider"), 
    min = 0, 
    max = 100, 
    value = 50
  ),
  sliderInput(
    "slider2", 
    label = h3("Slider range"), 
    min = 0, 
    max = 100, 
    value = c(25, 75)
  )
)

Screenshot 2024-06-04 at 4 45 23 PM

github-actions[bot] commented 1 month ago

This issue has been automatically locked. If you have found a related problem, please open a new issue (with a reproducible example or feature request) and link to this issue. :raising_hand: Need help? Connect with us on Discord or Posit Community.