diff options
| author | Jake Mannens <jake@asger.xyz> | 2023-08-28 23:34:45 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2023-08-28 23:34:45 +1000 |
| commit | b635a6581560f5c01311969779e974e6caca3f54 (patch) | |
| tree | 2491f99dfc6807d3600cba0f34e7ea727fdd4df4 /Pages | |
| parent | 05e0c2d26ccdbbcb2ce7de2c8c0fc8f0246fa709 (diff) | |
Fixed tab container tab duplication bug
Diffstat (limited to 'Pages')
| -rw-r--r-- | Pages/Component/TabContainer.razor | 5 | ||||
| -rw-r--r-- | Pages/Component/TabPane.razor | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/Pages/Component/TabContainer.razor b/Pages/Component/TabContainer.razor index 0dc1924..ed61f49 100644 --- a/Pages/Component/TabContainer.razor +++ b/Pages/Component/TabContainer.razor @@ -25,4 +25,9 @@ ActivePane = tabPane; StateHasChanged(); } + + public void RemovePane(TabPane tabPane) { + Panes.Remove(tabPane); + StateHasChanged(); + } }
\ No newline at end of file diff --git a/Pages/Component/TabPane.razor b/Pages/Component/TabPane.razor index 483d0d6..ba4a13a 100644 --- a/Pages/Component/TabPane.razor +++ b/Pages/Component/TabPane.razor @@ -1,4 +1,6 @@ -<link rel="stylesheet" href="@(nameof(HyperBooru)).styles.css"/> +@implements IDisposable + +<link rel="stylesheet" href="@(nameof(HyperBooru)).styles.css"/> @if(Parent.ActivePane == this) { @ChildContent @@ -20,4 +22,8 @@ Parent.AddPane(this); } + + public void Dispose() { + Parent.RemovePane(this); + } }
\ No newline at end of file |
