Auto-suggest list can't be navigated with keyboard
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 9.6k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Most auto-suggest controls tend to support keyboard-exclusive operation, i.e. once suggestions start to appear, you can press up/down arrows to navigate the list and either tab or enter (or both) to accept the highlighted suggestion. The WinUI auto-suggest behaves this way as well.
The WpfUI component doesn't seem to work that way. Suggestion list acts more like a popup that is out of the normal flow, can't be navigated or tabbed into, etc.
To Reproduce
- Create an app/page using a
<ui:AutoSuggestBox>or open the demo app to input page and scroll to AutoSuggestBox. - Start typing query.
- Press up/down/tab/enter keys while suggestions are open.
Expected behavior
Up/down keys change the highlighted suggestion. Tab and/or enter inserts the suggestion into the text box.
Screenshots
No response
OS version
Windows 10.0.19044
.NET version
6.0
WPF-UI NuGet version
N/A, built demo app directly from main branch.
Additional context
Mouse navigation is OK for some discoverability use cases, e.g. user doesn't know what options are available, or wants to see a list of popular suggestions, etc. However, auto-suggest is also often used as an accelerator, e.g. typing out a long file path and getting suggestions for the next directory. Without keyboard navigation, the control cannot be effectively used for the second set of use cases; having to continually switch between keyboard and mouse tends to take longer than typing the item in full.
Might be considered more of a feature request than a bug, but, as mentioned above, being able to navigate auto-suggestion lists with keyboard is pretty ubiquitous across existing desktop and web implementations.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the demo app's input page and locate the AutoSuggestBox described in the reproduction steps. Inspect the control's keyboard and suggestion-list behavior, then verify that Up/Down changes the highlighted suggestion and Tab and/or Enter accepts it while suggestions are open.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100