thisbeyond / solid-select

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

select.isOptionDisabled is not a function #28

Closed rob-forager closed 1 year ago

rob-forager commented 1 year ago

When using the latest version of solid-select (0.13.0) and the latest version of Solid (1.6.0) + Vite (3.1.8), I get this stack trace when clicking on the component:

dev.js:943 Uncaught TypeError: select.isOptionDisabled is not a function
    at get isDisabled [as isDisabled] (select.jsx:27:50)
    at Option._$effect._v$11 [as fn] (select.jsx:109:67)
    at runComputation (dev.js:693:22)
    at updateComputation (dev.js:676:3)
    at createRenderEffect (dev.js:205:75)
    at select.jsx:110:22
    at Option (select.jsx:109:108)
    at dev.js:515:12
    at untrack (dev.js:421:12)
    at Object.fn (dev.js:511:37)

Code:

<Select options={['TODO', 'TODO2']} />

I can stub that out like this (optionToValue is also needed):

<Select
  isOptionDisabled={() => false}
  optionToValue={(val) => val}
  options={['TODO', 'TODO2']}
/>

However at that point the component stops working, clicking on different select items doesn't change the value. It still fires the onChange event, but it doesn't update.

martinpengellyphillips commented 1 year ago

Confimed - looks like Solid JS 1.6.0 is the cause here as it works fine until upgrading to that version.

I'll chat to the community about what could be happening here.

martinpengellyphillips commented 1 year ago

Fixed in Solid JS 1.6.1 - please update to that version of Solid.