thisbeyond / solid-select

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

How To Get Index on onChange Handler? #25

Closed kapilpipaliya closed 1 year ago

kapilpipaliya commented 1 year ago

Thank you so much for the great library. I am using a single select and I want to get an index when option is selected. how to get an index of the function on onChange Handler?

martinpengellyphillips commented 1 year ago

That's not supported currently. It would be complex to implement as well because the selected value is independent of the options (you can actually set a value not present in the options programatically for example).

Instead you need to track it separately yourself (or use a unique id for each option as an object).