microsoft / microsoft/microsoft-ui-xaml

ComboBox select the first item even if no SelectedIndex is set

Open
#10,623 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

ComboBox will select the first item when opening the popup when no `SelectedIndex` is set. This is not an issue in WinUI2 and must have been a regression recently.

### Steps to reproduce the bug

WinUi3 Gallery:

![Image](https://github.com/user-attachments/assets/2d8c4046-2291-43e4-a153-2150be55e637)

Winui2 Gallery:

![Image](https://github.com/user-attachments/assets/c07d3905-c4d9-4469-845d-a7ce3085bff1)

### Expected behavior

_No response_

### Screenshots

_No response_

### NuGet package version

WinUI 3 - Windows App SDK 1.7.3: 1.7.250606001

### Windows version

Windows 11 (24H2): Build 26100

### 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

Reproduce the behavior in the WinUI 3 Gallery by opening a ComboBox popup without setting SelectedIndex, then compare it with the WinUI 2 Gallery shown in the report. Trace the ComboBox popup and selection behavior; done means the first item is not selected when no SelectedIndex is set, while explicit selection still works.

Written by the indexing model from the issue text.

Assessment

Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.