Select/Dropdown/Autosuggest
See original GitHub issueJust opening the issue to put together some links/ideas/suggestions about this/these component(s).
- https://www.w3.org/TR/2017/NOTE-wai-aria-practices-1.1-20171214/examples/combobox/aria1.1pattern/listbox-combo.html
- https://www.w3.org/TR/wai-aria-practices-1.1/examples/listbox/listbox-collapsible.html
- https://uxmastery.com/anatomy-of-an-accessible-auto-suggest/
- https://pattern-library.dequelabs.com/components/selects
- http://haltersweb.github.io/Accessibility/autocomplete.html
Initial thought on API:
<Dropdown.Container>
{dropdown => (
<Block>
<Dropdown.Input {...dropdown} />
<Dropdown.ArrowButton {...dropdown} />
{/* Maybe using Popover and Menu */}
<Dropdown {...dropdown}>
<Dropdown.Item>Item 1</Dropdown.Item>
<Dropdown.Item>Item 2</Dropdown.Item>
</Dropdown>
</Block>
)}
</Dropdown.Container>
EDIT: Update with v1 API
const listbox = useListboxState();
<Listbox {...listbox}>
<ListboxItem {...listbox}>item 1</ListboxItem>
<ListboxItem {...listbox}>item 2</ListboxItem>
<ListboxItem {...listbox}>item 3</ListboxItem>
</Listbox>
const listbox = useListboxPopoverState();
<ListboxButton {...listbox} />
<ListboxPopover {...listbox}>
<ListboxItem {...listbox}>item 1</ListboxItem>
<ListboxItem {...listbox}>item 2</ListboxItem>
<ListboxItem {...listbox}>item 3</ListboxItem>
</ListboxPopover>
const combobox = useComboboxListboxState();
<Combobox {...combobox} />
<ComboboxListbox {...combobox}>
<ComboboxListboxItem {...combobox}>item 1</ComboboxListboxItem>
<ComboboxListboxItem {...combobox}>item 2</ComboboxListboxItem>
<ComboboxListboxItem {...combobox}>item 3</ComboboxListboxItem>
</ComboboxListbox>
const combobox = useComboboxListboxPopoverState();
<Combobox {...combobox} />
<ComboboxListboxPopover {...combobox}>
<ComboboxListboxItem {...combobox}>item 1</ComboboxListboxItem>
<ComboboxListboxItem {...combobox}>item 2</ComboboxListboxItem>
<ComboboxListboxItem {...combobox}>item 3</ComboboxListboxItem>
</ComboboxListboxPopover>
Issue Analytics
- State:
- Created 5 years ago
- Reactions:18
- Comments:24 (18 by maintainers)
Top Results From Across the Web
Hidden Auto Suggestion drop-down values - How to handle in ...
First inspect the text field using developer tool selector or simply do right click > Inspect. · Go to 'Event Listeners' tab from...
Read more >Autocomplete Dropdown using native HTML
The input starts behaving like a select and when we start typing it searches inside the options of the datalist. Let's see it...
Read more >Click value from auto suggest dropdown in selenium
Click value from auto suggest dropdown in selenium · You can try just press enter key without arrow down. – Murthi · If...
Read more >How To Create Autocomplete on an Input Field - W3Schools
Example ; form autocomplete="off" action="/action_page.php" ; div class="autocomplete" style="width:300px;" ; input id="myInput" type="text" name="myCountry" ...
Read more >Editable Combobox With List Autocomplete Example - W3C
About This Example · Select-Only Combobox: A single-select combobox with no text input that is functionally similar to an HTML select element.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am using the Combobox in production: works well now 😃 Temporary documentation is at https://github.com/reakit/reakit/tree/master/packages/reakit/src/Combobox/
Hey @strass! I’m not sure if it’s the same design as yours, but I’ve created this example a few months ago: https://codesandbox.io/s/reakit-combobox-with-tags-smfgu
On the API, I imagine we could have a separate
Tag
component that could be combined withCombobox
, like this: https://twitter.com/diegohaz/status/1337358924236939268