svelte-select
svelte-select copied to clipboard
hidden input value doesn't get clear after clearing
Hi there,
I wanted to thank you for the awesome library you created. I've been using it for a project I'm working on, and it's been a great help.
I noticed one issue, though. When I hit the clear button after selecting an item, the hidden input value doesn't get cleared. This means that if I submit the form without selecting anything, it will still get the value that was selected last.
I'm not sure if this is a bug or if I'm doing something wrong.
<Select
items={facultySelect}
class="!input !input-bordered w-full max-w-md"
>
<svelte:fragment slot="input-hidden" let:value>
<input type="hidden" name="faculty" {...value} />
</svelte:fragment>
</Select>
@EssaAlshammri yeah looks like a bug.
Try this workaround for now... https://svelte.dev/repl/594b723e7f3a49f7a2c85a4ec665c1fd?version=3.59.1