-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[regression/8.0.0-preview.1.7762] [WinUI] An exception is thrown after removing an item from its close button #16324
Comments
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process. |
Verified this on Visual Studio Enterprise 17.8.0 Preview 1.0. This issue does not repro on Windows 11(8.0.100-preview.6.23330.14), Android 13.0-API33 and iOS 16.4 with below Project: |
Hi @marchev-prgs. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version. You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Interestingly, I still get an exception - "Child collection must not be modified during measure or arrange." |
I figured I can give you what I see in the Call Stack window of VS. I doubt it's of much use, but I guess it wouldn't hurt:
|
The root cause of the bug looks directly related to WinUI core issues with observable collections and collection views (ListView in this case). Bret already linked an existing and related bug in WinUI. I'll try to file a new one specific to this issue and attach a repro solution. |
Confirmed that this regressed between 7.0.92...8.0.0-preview.1.7762. #10999 and #13146 seem sus, but it could be one of the memory leaks fixes on bindings, too, perhaps? |
Unfortunatly this is an issue on WinUI related to microsoft/microsoft-ui-xaml#6350. We are working with the WinUI team to get this fixed, and as a workaround you can release the button's pointer capture before removing the item from the list. For example, the sample code linked on this issue would look like: private void ButtonClose_Clicked(object sender, EventArgs e)
{
Button button = (Button)sender;
#if WINDOWS
((Microsoft.UI.Xaml.Controls.Button)button.Handler.PlatformView).ReleasePointerCaptures();
#endif
string item = (string)button.BindingContext;
this.items.Remove(item);
} |
I'm going to backlog this issue for now. We're going to wait for this to be resolved by WinUI |
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process. |
Hi @marchev-prgs. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version. You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Description
I get the exception with 8.0.0-preview.6.8686, which I don't see listed in the versions list below)
An exception is thrown when an item is removed by clicking a close-button inside the item.
I have a simple item template, just a label and a close-button:
When I click the close button an exception is thrown:
Message: Child collection must not be modified during measure or arrange.
Interestingly, the stack trace is null.
ee-455020fde0ca)
Steps to Reproduce
Expected: The item should be removed and the CollectionView should become empty.
Actual: An exception is thrown.
Link to public reproduction project repository
https://github.com/telerik/ms-samples/tree/main/Maui/CollectionViewThrowsExceptionWhenClosingAnItem
Version with bug
8.0.0-preview.1.7762
Last version that worked well
7.0.92
Affected platforms
Windows
Affected platform versions
Did you find any workaround?
#16324 (comment)
Relevant log output
No response
Depends on
The text was updated successfully, but these errors were encountered: