Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SelectedItem not maintained in ComboBox when property was bound using CommunityToolkit.WinUI.FrameworkElementExtensions #4997

Open
3 of 14 tasks
ChidanandMurugaiah opened this issue Jul 2, 2024 · 2 comments
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior

Comments

@ChidanandMurugaiah
Copy link

Describe the bug

We are using the FrameworkElementExtension.Ancestor for the ComboBox.ItemsSource binding. When we unload the ComboBox, the binding remains active, causing the SelectionChanged event to trigger after the Unloaded event. As a result, the SelectedItem is not maintained in our application. This issue specifically occurs when using the FrameworkElementExtension from the CommunityToolKit.WinUI.Extensions package.

Sample - ComboBox_BindingIssue.zip

Unnecessary calls for SelectionChanged event after Unloaded event triggers - UnnecessaryCallForSelectionChanged.zip

Regression

No response

Reproducible in sample app?

  • This bug can be reproduced in the sample app.

Steps to reproduce

Replication Procedure

1.Run the sample
2.Click the drop down of the FrameworkElementExtension Binding combo box.
3.Select Personnel.
4.Click Reset Control button.

Expected behavior

Expected behavior - TextBox Text needs to be remains the same.
Observed behavior - TextBox Text changes to null.

Screenshots

Output_Video.mp4

Windows Build Number

  • Windows 10 1809 (Build 17763)
  • Windows 10 1903 (Build 18362)
  • Windows 10 1909 (Build 18363)
  • Windows 10 2004 (Build 19041)
  • Windows 10 20H2 (Build 19042)
  • Windows 10 21H1 (Build 19043)
  • Windows 11 21H2 (Build 22000)
  • Other (specify)

Other Windows Build number

No response

App minimum and target SDK version

  • Windows 10, version 1809 (Build 17763)
  • Windows 10, version 1903 (Build 18362)
  • Windows 10, version 1909 (Build 18363)
  • Windows 10, version 2004 (Build 19041)
  • Other (specify)

Other SDK version

No response

Visual Studio Version

2022

Visual Studio Build Number

17.10.1

Device form factor

Desktop

Nuget packages

CommunityToolKit.WinUI.Extensions - version - 8.0.240109
CommunityToolKit.Mvvm - version - 8.2.2
Microsoft.Windows.SDK.BuildTools - version - 10.0.22621.765
MicrosoftWindowsSDKApp - version - 1.5.240607001

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item.

@ChidanandMurugaiah ChidanandMurugaiah added the bug 🐛 An unexpected issue that highlights incorrect behavior label Jul 2, 2024
@ChidanandMurugaiah
Copy link
Author

Are there any updates regarding this issue? We created this issue last week but still we didn't get any updates from your side.

@weiyoucheng
Copy link

I look forward to fixing this bug as soon as possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior
Projects
None yet
Development

No branches or pull requests

2 participants