rob-balfre / svelte-select

Svelte Select. A select component for Svelte
https://svelte-select-examples.vercel.app
Other
1.25k stars 175 forks source link

justValue has been cleared when starting with a pre-loaded value #630

Open ferulisses opened 9 months ago

ferulisses commented 9 months ago

When using a complex collection and binding justValue with initial values, they are cleared on start:

I created a simulated error scenario: https://svelte.dev/repl/dbcdc5f78c55402a935f3b95c4414b3d?version=4.2.0

You can see at console that justValue is changed after svelte-select is initialized.

Ps. I could bypass this passing value={justValue} without binding, but got other errors when the collection of items is more complex

rob-balfre commented 9 months ago

justValue is a one way, read-only prop.

It can't be used to set value.

On Sun, 10 Sept 2023, 7:06 am Fernando Ulisses dos Santos, < @.***> wrote:

When using a complex collection and binding justValue with initial values, they are cleared on start:

I created a simulated error scenario: https://svelte.dev/repl/dbcdc5f78c55402a935f3b95c4414b3d?version=4.2.0

You can see at console that justValue is changed after svelte-select is initialized.

Ps. I could bypass this passing value={justValue} without binding, but got other errors when the collection of items is more complex

— Reply to this email directly, view it on GitHub https://github.com/rob-balfre/svelte-select/issues/630, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUAM7RDHUGKFCGD6USTN7LXZTK5RANCNFSM6AAAAAA4RVV7EE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ferulisses commented 9 months ago

Oh, thank you for the information. My fault, I was looking only on the examples.

You think that it's a good feature request or it's better to only add a note on examples?