microsoft / microsoft/microsoft-ui-xaml

ListView navigation keys are ignoring keyboard modifiers

Open
#9,885 0 comments 0 reactions 0 assignees View on GitHub
area-KeyboardAccelerators area-Lists bug team-Controls
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

ListView has navigation handling for Home/End/Arrow keys, but these should only be handling the un-modified case. For example, Home key correctly takes you to the top of the list, but Alt+Home does too, which it shouldn't.

### Steps to reproduce the bug

Run this, select an item in the list, and watch the keys being pressed in the debug output.

```xaml


Hello
World

```

```cs
private void StackPanel_KeyDown(object sender, KeyRoutedEventArgs e)
{
Debug.WriteLine($"Key: {e.Key}");
}
```

If you're on the first item and press End, you don't see the key, because the ListView consumed it with a navigation. (Press End again and you _do_ see it because the list doesn't navigate.)

But select the first item and press Alt+End and you don't see the End key in the debug output, and the ListView navigates. But it shouldn't navigate, shouldn't be handling the key, since a key modifier was pressed.

### Expected behavior

_No response_

### Screenshots

_No response_

### NuGet package version

WinUI 3 - Windows App SDK 1.5.5: 1.5.240627000

### Windows version

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the ListView navigation handling described in the issue and reproduce the behavior using the provided XAML and C# sample. Verify the Home, End, and Arrow key cases with modifiers; done means modified keys are not consumed for ListView navigation while unmodified keys retain their current behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.