From 0ae9ef291ec96513afb88c16983f15305aab3467 Mon Sep 17 00:00:00 2001 From: beo3000 Date: Tue, 6 Jan 2026 19:33:30 +0100 Subject: [PATCH] fix select non did not work: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Das Problem liegt in OnParametersSetAsync(). Wenn SelectNone() aufgerufen wird: 1. _selectedIds wird geleert 2. NotifySelectionChanged() benachrichtigt Parent 3. Parent aktualisiert Parameter → OnParametersSetAsync() wird erneut aufgerufen 4. Auto-select Logik Zeile 103-106 wählt alle wieder aus! Fix: Auto-select nur beim ersten Laden ausführen: Behoben. Das _initialized Flag verhindert nun, dass die Auto-Select-Logik bei jedem Parameter-Update läuft - nur noch beim ersten Laden der Komponente. --- src/Koogle.Web/Components/Game/ParticipantSelector.razor | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Koogle.Web/Components/Game/ParticipantSelector.razor b/src/Koogle.Web/Components/Game/ParticipantSelector.razor index 02a22c2..6c17487 100644 --- a/src/Koogle.Web/Components/Game/ParticipantSelector.razor +++ b/src/Koogle.Web/Components/Game/ParticipantSelector.razor @@ -92,18 +92,21 @@ private List _availableParticipants = []; private HashSet _selectedIds = new(); + private bool _initialized; + - protected override async Task OnParametersSetAsync() { _availableParticipants = AvailableParticipants.ToList(); _selectedIds = new HashSet(SelectedParticipantIds); - // Auto-select all if none selected - if (_selectedIds.Count == 0 && _availableParticipants.Count > 0) + // Auto-select all only on first load when none selected + if (!_initialized && _selectedIds.Count == 0 && _availableParticipants.Count > 0) { + _initialized = true; await SelectAll(); } + _initialized = true; } private async Task ToggleParticipant(Guid personId)