microsoft / microsoft/microsoft-ui-xaml
ItemsView "Extended" selection does not behave the same as ListView when clicking already selected item
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
On a `ListView` with `SelectionMode="Extended"`, if you use Ctrl/Shift+Click to select multiple items, then you click one of the selected items, it resets the selection to just the clicked item.
On an `ItemsView` with `SelectionMode="Extended"`, doing the same thing makes no change to the selection.
### Why is this important?
This behavior isn't consistent with other Windows apps (e.g. File Explorer, Outlook, etc.). It also means that if you select everything (Ctrl+A) and then want to go back to just selecting one item, the way to do that is not obvious. You have to first Ctrl+Click an item to deselect it, and then you can click the unselected item to reset the selection to just that item.
### Steps to reproduce the bug
1. Open WinUI 3 Gallery and go to the ListView page.
2. In the ListView with Selection Support example, set the SelectionMode to Extended.
3. Click in the list and press Ctrl+A to select everything.
4. Click on a single item. The selection reset to just that item.
5. Go to the ItemsView page.
6. In the ItemsView item invocation and selection example, set the SelectionMode to Extended.
7. Click on the list and press Ctrl+A to select everything.
8. Click on a single item. Nothing changes.
### Actual behavior
Clicking on an already-selected item does nothing.
### Expected behavior
Clicking on an already-selected item should reset the selection to just that item.
### Screenshots
_No response_
### NuGet package version
1.8.260416003
### Windows version
Windows 11 (24H2): Build 26100
### Additional context
_No response_
Contributor guide
Research direction
Start with the WinUI 3 Gallery ListView and ItemsView selection support examples described in the reproduction steps, then trace how Extended selection handles clicks on selected items. Compare the two controls and verify that an already-selected ItemsView item resets selection to that item without changing other selection behavior.
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
- 55/100