Skip to content

Visual selected state does not get reset when select is cleared #257

@jochienabuurs

Description

@jochienabuurs

When using the keyboard to select a value from a select, the visually selected state (managed by adding a .sv-dd-item-active class) does not get reset when the select is cleared.

See the first example: https://svelecte-v5.vercel.app/examples#multiselect

Steps to reproduce:

  • Clear the input by clicking on the X inside it.
  • Select the input by clicking it.
  • Then use the keyboard arrows to navigate to a value (f.e. "Fuchsia")
  • Press enter to select it. (the input label changes to "1 selected")
  • Clear the input by clicking on the X inside it.
  • Select the input by clicking it.
  • Notice that "Fuchsia" visually has a selected state, even though it's not actually selected.

Even when using highlightFirstItem={false} and disableHighlight={true} this behavior does not change.

Am I missing something? Do i manually need to remove the class altogether when no value is selected?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions