hperrin / svelte-material-ui

Svelte Material UI Components
https://sveltematerialui.com/
Apache License 2.0
3.31k stars 285 forks source link

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

Open YuruCuse opened 1 year ago

YuruCuse commented 1 year ago

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

nbaillie commented 1 year ago

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?