From 5d410f8b273d6b4f3193d7d0c9c345244c833569 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Vido=CC=81czi=20Pe=CC=81ter?= <>
Date: Mon, 20 Jul 2026 15:39:29 +0200
Subject: [PATCH] fix(select): fix multiselect initialization race condition in
options
---
.../widgets/forms/components/option/option.component.html | 4 ++--
.../widgets/forms/components/option/option.component.ts | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/projects/widgets/forms/components/option/option.component.html b/projects/widgets/forms/components/option/option.component.html
index 43cbfcd3..7345869f 100644
--- a/projects/widgets/forms/components/option/option.component.html
+++ b/projects/widgets/forms/components/option/option.component.html
@@ -1,9 +1,9 @@
-@if (_multiSelect) {
+@if (_multiSelect()) {
}
-@if (!_multiSelect && selected()) {
+@if (!_multiSelect() && selected()) {
}
diff --git a/projects/widgets/forms/components/option/option.component.ts b/projects/widgets/forms/components/option/option.component.ts
index b8675561..2744a066 100644
--- a/projects/widgets/forms/components/option/option.component.ts
+++ b/projects/widgets/forms/components/option/option.component.ts
@@ -65,7 +65,7 @@ export class IdsOptionComponent
protected _groupOrOptionIsDisabled = computed(() => this.group?.disabled() || this.disabledInput());
- protected readonly _multiSelect = Boolean(this._parent?.multiSelect());
+ protected readonly _multiSelect = computed(() => Boolean(this._parent?.multiSelect()));
public selectionChange = output>();
public selectionUnchanged = output>();
@@ -75,7 +75,7 @@ export class IdsOptionComponent
this.selected() ? 'selected' : null,
this._active() ? 'active' : null,
this._groupOrOptionIsDisabled() ? 'disabled' : null,
- this._multiSelect ? 'multiselect' : null,
+ this._multiSelect() ? 'multiselect' : null,
this.size(),
this.variant(),
]));
@@ -178,7 +178,7 @@ export class IdsOptionComponent
}
private _emitSelectionChangeEvent(selected: boolean, isUserInput = false): void {
- if (this._multiSelect || !this.selected()) {
+ if (this._multiSelect() || !this.selected()) {
this.selectionChange.emit(new IdsOptionSelectionChange(this, selected, isUserInput));
} else {
this.selectionUnchanged.emit(new IdsOptionSelectionChange(this, selected, isUserInput));