Skip to content

Multiple occurrences disappear in selectize #655

Closed

Description

@NicolasConrath

There seem to be a bug with shiny selectize when the user enters a string of mutliple words with common letters : part of the words or even whole words disappear in the proposed inputs.

Here's a small example, try typing "letters letters" in the following selectize input

ui.input_selectize( "id", "try typing several words", ['', 'letters letters example', 'look letters disapear !' ] )

You can also try that one where you can see that even if the words have one letter in common the weird behaviour occurs

ui.input_selectize( "id", "try typing several words", ['', 'king of kingdom', 'king of internet', 'king of galaxy' ] )

Activity

  1. added
    bug
    on Aug 3, 2023
  2. gshotwell commented on Aug 3, 2023

    @gshotwell

    Good catch and a very odd bug.

    To reproduce on shinylive, type "let let" then backspace out, selectize drops letters and doesn't reset when you clear the search term.

  3. gadenbuie commented on Aug 3, 2023

    @gadenbuie
    Collaborator

    I think this is common to Shiny for Python and R, I can reproduce with this small app:

    library(shiny)
    
    ui <- fluidPage(
      selectInput("id", "words", c("", "letters letters example", "look letters disappear"))
    )
    
    shinyApp(ui, function(...) {} )

    Interestingly, it only affects the label, the selected value is correct but it's probably a bug in how the selection highlighting is being cleared.

  4. gshotwell commented on Aug 4, 2023

    @gshotwell

    Thanks for the reproduction, weird that nobody has reported this on the R side.

  5. cpsievert commented on Aug 21, 2023

    @cpsievert
    Collaborator

    Appears as though updating to selectize.js v0.15.2 (as we're hoping to do in R via rstudio/shiny#3875) fixes this issue. Unfortunately, we probably won't actually upgrade in R until this new regression gets addressed, but if this is urgent for Python, you could work around that issue by enabling the remove_button plugin (which IMO provides a better default experience anyway). Here's how you can opt-into that plugin in R

    library(shiny)
    
    ui <- fluidPage(
        selectizeInput(
            "id", "words", c("", "letters letters example", "look letters disappear"), 
            multiple = TRUE, options = list(plugins = "remove_button")
        )
    )
    
    shinyApp(ui, function(...) {} )
  6. cpsievert commented on Dec 5, 2023

    @cpsievert
    Collaborator

    This should be fixed now (in the development version) thanks to #819

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions