diff options
| author | Jake Mannens <jake@asger.xyz> | 2023-08-29 01:59:45 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2023-08-29 01:59:45 +1000 |
| commit | b97c475d2f5b6c4c87719beeab02d1aeacf8a288 (patch) | |
| tree | be6344f6bc8c47d04fa298813ef74375395e60f5 /Pages/Component/TabContainer.razor | |
| parent | 8ae2a55f416aac0dc458a41931b7680035725b90 (diff) | |
Fixed bug in tab containers where a state change could result in an empty tab pane being shown
Diffstat (limited to 'Pages/Component/TabContainer.razor')
| -rw-r--r-- | Pages/Component/TabContainer.razor | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Pages/Component/TabContainer.razor b/Pages/Component/TabContainer.razor index ed61f49..3caab0b 100644 --- a/Pages/Component/TabContainer.razor +++ b/Pages/Component/TabContainer.razor @@ -16,7 +16,7 @@ [Parameter] public RenderFragment ChildContent { get; set; } - public TabPane ActivePane { get; set; } + public TabPane? ActivePane { get; set; } List<TabPane> Panes = new(); public void AddPane(TabPane tabPane) { @@ -27,6 +27,8 @@ } public void RemovePane(TabPane tabPane) { + if(ActivePane == tabPane) + ActivePane = Panes.ElementAtOrDefault(0); Panes.Remove(tabPane); StateHasChanged(); } |
