microsoft / microsoft/microsoft-ui-xaml

NavigationView tab switching issue when using arrowkeys

Open
#11,049 0 comments 0 reactions 0 assignees View on GitHub
area-NavigationView bug
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

When switching between tabs of Navigationview with selectionfollowsfocus enabled, switching forward is fine, but when switching back, at a certain moment, the tab immediately before the current focus is skipped and selection jumps two tabs backwards

### Why is this important?

This is more of a user experience issue as it could cause possible confusion to have a tab skipped for seemingly no reason

### Steps to reproduce the bug

I will use WinUI3 Gallery app to describe the issue
1. Go to NavigationView > Typing selection and focus - Tabs
3. Navigate slowly between Item1, Item2, Item3 and Item4 tabs using the arrowkeys
4. Once the animation to switch to Item3 (or Item4, the aim is to have at least two items behind the current selection. It does also just do nothing if there's only one tab behind) is complete immediately try to go back to the previous item (Item2 or Item3)

### Actual behavior

The immediately preceding item is skipped and the further one (Item1 or Item2) is selected instead

### Expected behavior

Seamless switching between all tabs either backwards or forward

### Screenshots

https://github.com/user-attachments/assets/0d5285c4-72d8-404e-9d10-b4aa68d94b66

### NuGet package version

1.8.260317003

### Windows version

Windows 11 (24H2): Build 26100, Windows 11 (23H2): Build 22631

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in the WinUI3 Gallery at NavigationView > Typing selection and focus - Tabs, using slow arrow-key navigation during the tab-switching animation. Then inspect the NavigationView focus and selection handling for backward movement; done means each preceding tab is selected once without being skipped.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.