lepoco / lepoco/wpfui

AutoSuggestBox doesn't handle tabs correctly

Open
#1,405 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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
  1. Create a page with a few text box controls and an AutoSuggestBox.
  2. Set a TabIndex on each control.
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.