fix select non did not work:

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.
This commit is contained in:
beo3000 2026-01-06 19:33:30 +01:00
parent 745da9e678
commit 0ae9ef291e
1 changed files with 6 additions and 3 deletions

View File

@ -92,6 +92,7 @@
private List<DayParticipantDto> _availableParticipants = [];
private HashSet<Guid> _selectedIds = new();
private bool _initialized;
protected override async Task OnParametersSetAsync()
@ -99,11 +100,13 @@
_availableParticipants = AvailableParticipants.ToList();
_selectedIds = new HashSet<Guid>(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)