Skip to content

Commit 5d3ee68

Browse files
Fix tab switching by removing field shadowing in Edit.razor.cs
The Edit component was declaring its own private fields for activeTab, errorMessage, and successMessage, which shadowed the protected fields from CustomComponentBase. This prevented SetActiveTab() from working correctly since it updated the base class field but the UI read from the local field. Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
1 parent 0b21332 commit 5d3ee68

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • EstateManagementUI.BlazorServer/Components/Pages/Merchants

EstateManagementUI.BlazorServer/Components/Pages/Merchants/Edit.razor.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ public partial class Edit {
2020
private MerchantModels.MerchantModel? merchant;
2121
private bool isLoading = true;
2222
private bool isSaving = false;
23-
private string? errorMessage;
24-
private string? successMessage;
25-
private string activeTab = "details";
2623

2724
// Unified model for editing
2825
private MerchantModels.MerchantEditModel merchantEditModel = new();
@@ -49,6 +46,11 @@ public partial class Edit {
4946
private bool showAddDevice = false;
5047
private string? deviceIdentifier;
5148

49+
protected override async Task OnInitializedAsync() {
50+
await base.OnInitializedAsync();
51+
this.SetActiveTab("details");
52+
}
53+
5254
protected override async Task OnAfterRenderAsync(bool firstRender) {
5355
if (!firstRender) {
5456
return;

0 commit comments

Comments
 (0)