thisbeyond / solid-select

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

Move component specific logic to builtin components #26

Open martinpengellyphillips opened 1 year ago

martinpengellyphillips commented 1 year ago

Currently the core has some logic to control visibility of the input, but this only makes sense for the specific component implementation. A custom component setup might not want this (e.g #23) so move it out of the core and into the builtin Input component instead.

Relevant code: element.style.setProperty("opacity", inputIsHidden() ? "0" : "1");

Similarly, it might be better to have the control of the input value moved to the component level rather than core: createRenderEffect(() => (element.value = inputValue()));

Alternatively, move to returning props to set in the custom components for all the component specific logic, rather than automatically adding in the core.