When using label with htmlFor, its referenced element is not triggering focus. Here is a sandbox with an example:
https://codesandbox.io/s/3r4l5o2qwp
React: 16.3.2
React-Select: 2.0.0-beta.6
This prevents us from advanced styling with label, such as this case:
The text element in the first image is a label on top of react-select, and clicking on it does not open/focus the select. I can only start typing clicking outside the label.
Use inputId
instead id
<label htmlFor="second">second</label>
<Select options={options} name="second" inputId="second" />
@someden awesome, that did the work. Thanks
You can add openMenuOnFocus
to open the menu on label click.
Most helpful comment
Use
inputId
insteadid