Semantic-UI-React
Semantic-UI-React copied to clipboard
Allow Dropdowns to handle being focussed from a label
Feature Request
Problem description
Form selects don't focus themselves when clicking an associated label. There is a workaround for ones with a search
prop, but seemingly no way of doing it for the others
Proposed solution
If a <Dropdown>
, <Select>
or <Form.Select>
is passed an id
prop, it should support focussing when clicking a label with a matching htmlFor
prop, whether generated from the label
field or otherwise
Demonstration of current behaviour:
https://codesandbox.io/s/semantic-ui-react-forked-3ey2b?file=/index.js
Do you have a link to the workaround for "ones with a search prop" that you mentioned? This seems to impact testing with something like react-testing-library where ideally you select by label as well. And I would imagine accessibility as well.
oh, I see the sandbox showed the workaround. thank you.