thisbeyond / solid-select

The Select component for Solid.
https://solid-select.com
MIT License
172 stars 18 forks source link

Fix Error When Options Value is Array #24

Open kapilpipaliya opened 1 year ago

kapilpipaliya commented 1 year ago

I am getting this error when I have option value is array: Uncaught Error: Incompatible value type for single select.

martinpengellyphillips commented 1 year ago

Value needs to be an array when setting value for a multiple select.

So the error is correct.

kapilpipaliya commented 1 year ago

yes, but I did this PR for single select. when single select the value can be a Array too.

martinpengellyphillips commented 1 year ago

I'm not sure what you mean. When using a single select the value should be scalar (not an array). Are you saying you want to support setting an array for a single select?

kapilpipaliya commented 1 year ago

yes, I want the support of array for a single select, because my single select option value is an array.

martinpengellyphillips commented 1 year ago

That sounds like an interesting use case and not one I expected. Could you share your example use case?

Internally we don't expect arrays and it might break in places so I'll need to check that.