question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[combobox] Allow automatic selection of first option

See original GitHub issue

🚀 Feature request

Current Behavior

While typing into a ComboboxInput, no ComboboxOption elements are selected.

Desired Behavior

While typing into a ComboboxInput, there should be an optional behavior to allow the first ComboboxOption element to be automatically selected.

Suggested Solution

Example 2: List Autocomplete with Automatic Selection from the official ARIA examples shows the intended behavior: https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html

Adding an autoSelectFirstOption?: boolean prop to the Combobox component would be a convenient solution.

Who does this impact? Who is this for?

This impacts users looking to implement smoother auto-completion flows with a combobox.

Describe alternatives you’ve considered

I have considered manually calling focus() on a ref of the first ComboboxOption but this does not result in the element being selected.

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
logeekalcommented, Mar 30, 2021

Working on it.

1reaction
dmamiecommented, Apr 4, 2021

@logeekal we’ve faced the exact same UX issue.

in our humble opinion option 2 is more user-friendly.

thanks so much for working on it! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - How to disable the automatic selection of the first item in ...
How to disable the automatic selection of the first item in ComboBox? · Invert the assignments: comboBox1.DroppedDown = true; comboBox1.Text = "A ...
Read more >
Prevent Wijmo ComboBox to select the first item automatically
Any solution how to do it? Hi, You will need to set the isRequired property of the ComboBox to false and the value...
Read more >
how to prevent combobox from auto selecting item when ...
Just set SelectedIndex property of the combo box to -1 like, this.combobox1.SelectedIndex=-1 after data binding and it will not select anything ...
Read more >
Microsoft Access Form Selecting the First Item in a ComboBox ...
By default, the value is blank but when you initialize or refresh a ComboBox or ListBox, you may want to select the first...
Read more >
Dropdown | Select2 - The jQuery replacement for select boxes
text which will periodically be displayed, which allows you to add more advanced formatting to these automatically generated options. You must ensure that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found