-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make searchable dropdown accessible #3149
Make searchable dropdown accessible #3149
Conversation
The searchable Dropdown component passes the id prop to the top level component, instead of its input. Now, it extracts the id from what is returned by getUnhandledProps and forwards it to the DropdownSearchInput component
💖 Thanks for opening this pull request! 💖 Here is a list of things that will help get it across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
Codecov Report
@@ Coverage Diff @@
## master #3149 +/- ##
=========================================
Coverage ? 99.92%
=========================================
Files ? 163
Lines ? 2746
Branches ? 0
=========================================
Hits ? 2744
Misses ? 2
Partials ? 0
Continue to review full report at Codecov.
|
@arthurdenner thanks for PR but I don't want to merge it because this behaviour can be reached with existing functionality. The <Dropdown search searchInput={{ id: 'foo', type: 'number' }} options={options} /> And example is also there: http://react.semantic-ui.com/modules/dropdown/#usage-search-input |
Possible, we should update |
Hm, sorry, I didn't notice this. However, inside a form, a searchable dropdown still not being accessible because the See this: https://codesandbox.io/s/x2lz8qwlrw Maybe only ignoring the |
It's a little unclear, but works: <Form.Field
control={Select}
options={genderOptions}
label={{ children: "Gender", htmlFor: 'form-select-control-gender' }}
placeholder="Gender"
search
searchInput={{ id: "form-select-control-gender" }}
/> |
Yep, that's very unclear because is totally different from the Thanks for the help! |
Can I open a PR adding this as an example to the |
@arthurdenner yes, please! 👍 |
Current behaviour:
A
Dropdown
/Select
component with thesearch
prop inside a Form is not accessible since theid
prop is passed to the top level component instead of theinput
element.New behaviour:
The
id
prop is passed to theinput
element.It was added an example of an accessible searchable Dropdown.
If you want tests for this or have any changes to suggest, please let me know.