-
Notifications
You must be signed in to change notification settings - Fork 757
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
Combobox disappears when reopened #12845
Comments
Thanks for the report. In the repro sample you're providing, you're using a string as the input, and this is not supported by WinUI. Is your original issue using the same "string" binding as the item source? |
The string binding was just a simple way to make an example because it has the exact same response as the other inputs. I also tested both Binding and x:Bind but those still gave the issue regarding the disappearing views while still functioning properly. Would you like me to include an example project with those other inputs? |
I'm an idiot, sorry first time doing a propper issue, This is not professional. My bad. |
No worries about closing the issue :) Are you able to reproduce the issue with the Uno Playground? Here's an example: https://playgroundcanary.z19.web.core.windows.net/#combobox |
I'm unable to reproduce it uno playground, I tried that yesterday to be sure. I also copied the xaml into VS22 in my uno enviroment (.net7) and it has the same problem. I tried it in the .net6 test project and it works just fine. |
Thanks. To be sure, you're testing in WebAssembly, specifically? |
in both webassembly and skia.wpf. |
Thanks for the update. Note for contributorsIt seems that for some reason, the contents of the Frame is getting cleared when opening the popup for the second time. This does not repro in the playground (http://playground.platform.uno/#ef1ff7f8). It is not related to |
Previously we were clearing ItemsControl items' DataContext instead of nulling them out. Unsetting the DP value caused inheritance to take over, and that meant the item temporarily gained the DataContext of the ItemsControl - which could have been a UIElement, which then caused it to become the item's Content. This caused very odd issues like #12845.
@headslash the piece of the code that cause the issue to happen is the |
Previously we were clearing ItemsControl items' DataContext instead of nulling them out. Unsetting the DP value caused inheritance to take over, and that meant the item temporarily gained the DataContext of the ItemsControl - which could have been a UIElement, which then caused it to become the item's Content. This caused very odd issues like #12845. (cherry picked from commit 02b42f4)
Previously we were clearing ItemsControl items' DataContext instead of nulling them out. Unsetting the DP value caused inheritance to take over, and that meant the item temporarily gained the DataContext of the ItemsControl - which could have been a UIElement, which then caused it to become the item's Content. This caused very odd issues like #12845. (cherry picked from commit 02b42f4)
Current behavior
Opening Combobox with Binding in Itemsource works like it should. Dropdown opens with all options. You select one, it binds back like it should.
You reopen it to select something else and...
The whole view that it is in disappears. There is no way other than resetting the application or reloading it to reset it.
I found it while working on a bigger application that uses smaller generated views that could include comboboxes. in those cases it would delete the childview altogether.
I replicated in a minimalistic/same enviroment in the MainPage.
Both the combobox with or without binding has the same issue.
This is in .net7.
recreating this in .net6 does not give the same issue.
Expected behavior
Using a combobox for a second time works like it should, not removing the view altogether
How to reproduce it (as minimally and precisely as possible)
UnoApp1 - example.zip
Workaround
Instead of using
using
Does work but bindings are not really an option in my case.
Works on UWP/WinUI
None
Environment
Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
NuGet package version(s)
all current updated stable versions
no extra ones
Unoplatform extension 4.9.12.12
using .net7
Affected platforms
WebAssembly, Skia (WPF), Skia (GTK on Linux/macOS/Windows)
IDE
Visual Studio 2022
IDE version
17.6.2
Relevant plugins
none
Anything else we need to know?
No response
The text was updated successfully, but these errors were encountered: