Skip to content

Updating Select components value while also changing the Options causes the value to be undefined #538

Open
@YuruCuse

Description

@YuruCuse

Describe the bug
Setting the value of a Select component at the same time the Options are updated causes the Select component's value to change once, and then change again to undefined

To Reproduce
(See REPL here: https://svelte.dev/repl/7e74d75b52a84e09b4ad7aff4342ddf3?version=3.53.1)

  1. Select a value from the first Select. This will change the Options in the 2nd Select
  2. Watch console and you will see the value of the 2nd Select value change once and then change again to undefined

Expected behavior
Expect the value to get set and keep it. The expected behavior can be seen in the same REPL using the basic select element

Screenshots
(See REPL here: https://svelte.dev/repl/7e74d75b52a84e09b4ad7aff4342ddf3?version=3.53.1)
image

Activity

nbaillie

nbaillie commented on Apr 16, 2023

@nbaillie

I something simalar but when change the options and value i see the second value set in console log corectly but the selector visually does not update (if i click on the selector i can see the correct value is selected then, but whern i click away it dose not show in the ui).. and when i change back to native select and options it works correctly.
Any ideas on workarounds?

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

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @nbaillie@YuruCuse

      Issue actions

        Updating Select components value while also changing the Options causes the value to be undefined · Issue #538 · hperrin/svelte-material-ui