AutoSuggestBox doesn't handle tabs correctly
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
The auto suggest box has two tab stops, one on the outside border of the control, and one on the inner text box part. There's no way to set the TabIndex on the textbox part.
To Reproduce
- Create a page with a few text box controls and an AutoSuggestBox.
- Set a TabIndex on each control.
- Run the app, and tab through each control on the page
Actual behavior:
The tabs are hit in expected order, except the tab to the AutoSuggestBox only highlights the control, and the user can't just begin typing. Also, after other controls are tabbed through, the AutoSuggestBox get another tab focus, this time on the actual textbox so the user can begin typing. Setting IsTabStop=False on the AutoSuggestBox will not stop this.
Expected behavior
On keyboard focus, the AutoSuggestBox should set focus to the textbox part, so the user can just tab to the control and start typing.
The outer part of the AutoSuggestBox should not be focusable.
The textbox part of the control should inherit TabIndex and IsTabStop values from it's template binding, so they can easily be set on the AutoSuggestBox control in XAML.
Screenshots
No response
OS version
Windows 11
.NET version
9.0
WPF-UI NuGet version
4.0.2
Additional context
No response
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 by reproducing the tab sequence described with an AutoSuggestBox and several text box controls on Windows 11, using .NET 9.0 and WPF-UI 4.0.2. Then locate the AutoSuggestBox control and its template, and verify that the outer control is not an extra tab stop, while the inner textbox receives focus and the expected TabIndex and IsTabStop values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100