Skip to content

Reactive selected prop #136

@cbenz

Description

@cbenz

I'm surprised to read in the docs that the selected prop is static ("[...] or passed as prop to set pre-selected options that will already be populated when the component mounts before any user interaction").

In my case, the selected options depend on the external context, the URL params, and when I go back/forward the MultiSelect has to update in consequence.

This worked as I expect with version 6.1.0 but since version 7.1.0, the selected prop has become static (it does not take new values into account).

Is this intended behavior?

As a workaround, I did use:

{#key selected}
  <MultiSelect {options} {selected} />
{/key}

Here is a quick-made REPL to demonstrate this: https://svelte.dev/repl/153f9049a9b849aa9fcc95117061a867?version=3.52.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdxDeveloper experiencetestsTest all the things

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions