solid-select icon indicating copy to clipboard operation
solid-select copied to clipboard

Passing in ref not working

Open koolkao opened this issue 1 year ago • 2 comments

When I pass in a reference like below, similar to the SolidJS tutorial, the ref ends up being undefined

let selectRef; return <Select ref={selectRef}>

koolkao avatar Jun 06 '23 08:06 koolkao

ref is not mapped to anything today in the default Select component. What are you trying to achieve?

martinpengellyphillips avatar Jun 06 '23 19:06 martinpengellyphillips

Thank you for the response. I'm trying to send focus to <Select>. Something like:

let ref; <div onClick={ ()=> ref.focus() }>label</div> <Select ref={ref}></Select>

Is there a better way to do this? thank you

koolkao avatar Jun 06 '23 20:06 koolkao

I guess this should pass ref through to Input essentially. Will take a look at that.

martinpengellyphillips avatar Jun 29 '24 01:06 martinpengellyphillips

Added in 2281a3cd39a7ca680b8fbce582c716ff4fbafd24 - will be available once released with an example on the website to match.

martinpengellyphillips avatar Jun 29 '24 09:06 martinpengellyphillips

Release 0.15.0 has now been published which should address this. See new example at https://solid-select.com/?example=Focus%2520with%2520ref

martinpengellyphillips avatar Jul 06 '24 22:07 martinpengellyphillips