just as className is appended to the class name of the rendered element, the passed in id attr should be used as the id for the rendered element.
This will allow <Select> components to work with the alternative label form, e.g.
<label htmlFor='my_input'>my input</label>
<Select id='my_input' {...props} />
I just noticed there's an inputProps prop which allows you to set the id on the input itself. Can you try that out?
@banderson ooh that works perfectly for my use case, clicking the label now can focus the input.
@macgyver apparently passing inputProps does nothing if the <Select> is not searchable...
renders a div instead of an input if the <Select> is not searchable, which causes a label's htmlFor to not trigger a focus on the associated select.
that's a bummer :/
Indeed, this bug is still present, providing an id props doesn't generate an ID in the HTML markup.
Using 1.0.0-rc.10
Edit: Updating to 1.2.1 fixed it!
in version >= 2 to set the id on the Select use <Select inputId="foo" />.
Most helpful comment
in version
>=2 to set the id on the Select use<Select inputId="foo" />.