microsoft / microsoft/microsoft-ui-xaml

RadioButtons SelectionChanged trigger twice

Open
#9,917 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-RadioButtons bug team-Controls
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

This has been an issue in UWP in #3128 , and someone was even kind enough to make a PR to fix it #3137 , but you guys just closed it because winui2 is no longer developed? And don't even check for it in winui3? So I just wasted another hour stumble upon this issue in WinUI3.

### Steps to reproduce the bug

1. Create a new winui3 project
2. In `MainWindow.xaml` use this code
```xml




```
3. In the handler code, just add a debug print.
4. The initial selection will trigger it once as expected. Select another item, this event handler will be triggered twice.

### Expected behavior

_No response_

### Screenshots

_No response_

### NuGet package version

WinUI 3 - Windows App SDK 1.5.6: 1.5.240802000

### Windows version

Windows 11 (22H2): Build 22621

### Additional context
[Repro](https://github.com/HO-COOH/WinUI-Bug/tree/main/16-RadioButtonsSelectionChangedTriggerTwice)

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

Begin with the repro's MainWindow.xaml and RadioButtons_SelectionChanged handler, then run it against Windows App SDK 1.5.6 to confirm the duplicate event. Trace the RadioButtons selection-change path and verify that selecting another item produces one SelectionChanged callback, while the initial selection still behaves as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.