pstanoev / simple-svelte-autocomplete

Simple Autocomplete / typeahead component for Svelte
http://simple-svelte-autocomplete.surge.sh/
MIT License
464 stars 78 forks source link

Object comparison breaks down in dropdown #180

Open srcrip opened 2 years ago

srcrip commented 2 years ago

Check out this example where the dropdown properly reflects the selected value: https://svelte.dev/repl/6f872d21bd7c49a6b25ab50a37011b31?version=3.49.0

And then this one where it does not: https://svelte.dev/repl/cbab93a181ff4c6687f6adc147e66ded?version=3.49.0

It seems like object comparison is just happening using == or === when it needs to have a more complex comparison? Since there's already logic to select out the 'valueFieldName' and many people are going to be using a unique id there, maybe it can default to that?