Open JsonTextfield opened 3 years ago
We observed the same behaviour. In our case, it happens when there are 2 last tab items and we close the left-most tab.
Version | |
---|---|
Microsoft.NETCore.UniversalWindowsPlatform |
6.2.14 (currently, the latest stable) |
Microsoft.UI.Xaml |
2.8.2 (currently, the latest stable) |
Windows 10 Pro | 22H2 (Windows Feature Experience Pack 120.2212.4190.0) |
Describe the bug
When closing the left-most tab, calling
sender.TabItems.Remove(args.Tab);
in the TabCloseRequested event handler whileIsAddTabButtonVisible = false
causes aSystem.ArgumentException
.Steps to reproduce the bug
IsAddTabButtonVisible = false
and create an event handler forTabCloseRequested
.TabCloseRequested
event handler, callsender.TabItems.Remove(args.Tab);
.Expected behavior Expected the left-most tab to close when its X button is pressed. Currently, an exception is thrown instead:
Screenshots
Version Info
NuGet package version: Microsoft.UI.Xaml 2.5.0
Additional context Current workaround is to set
IsAddTabButtonVisible = true
before callingsender.TabItems.Remove(args.Tab);
: