Skip to content

selectizeInputs can lose their bookmarked values on restoration #4263

@JohnADawson

Description

@JohnADawson

When an application is bookmarked and restored selectizeInputs can lose their values.

An example follows.

ui <- function(request) {
  shiny::fluidPage(
    shiny::selectizeInput(
      "my_selectize",
      "Selectize",
      character(0L),
      multiple = TRUE,
      options = list(create = TRUE)
    ),
    shiny::verbatimTextOutput("my_text"),
    shiny::bookmarkButton()
  )
}

server <- function(input, output, session) {
  output$my_text <- shiny::renderPrint(input$my_selectize)
}

shiny::shinyApp(ui, server, enableBookmarking = "url")

Run the application.

Image

In the selectizeInput enter "a,b,", so that the input's value is c("a", "b").

Image

Click "Bookmark...".

Image

Restore the application.

Image

The input's value is NULL but ought to be c("a", "b").

The fault was observed when the browser was Firefox 141.0 (64-bit) and sessionInfo() was as follows.

R version 4.3.3 (2024-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 24.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so;  LAPACK version 3.12.0

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
 [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
 [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

time zone: Europe/London
tzcode source: system (glibc)

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

loaded via a namespace (and not attached):
[1] compiler_4.3.3 tools_4.3.3    renv_1.1.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions