mskocik / svelecte

Flexible autocomplete/select component written in Svelte,
https://svelecte.vercel.app
MIT License
472 stars 44 forks source link

Svelecte changes initial value of empty string to null #244

Closed vince-winkintel closed 3 months ago

vince-winkintel commented 3 months ago

When binding to a value that is an empty string, Svelecte is updating it to a null value upon loading. If the value is a space character, it behaves as expected.

Here is a REPL link to demonstrate it: https://svelte.dev/repl/27ee71f455904a0abb4163a68f4bb59c?version=4.2.18

The expectation is that Svelecte will accept an empty string and not change the bounded value to null.

mskocik commented 3 months ago

Real edge case, but fixed. As a bonus it can handle also 0 properly 🙂