From 8914be4648ec4a14763b68c92c251542ee82ab5a Mon Sep 17 00:00:00 2001 From: rosenthalj <45439491+rosenthalj@users.noreply.github.com> Date: Tue, 7 Nov 2023 05:02:38 -0500 Subject: [PATCH] Update selectbutton.ts check allowEmpty test before setting selected --- src/app/components/selectbutton/selectbutton.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/components/selectbutton/selectbutton.ts b/src/app/components/selectbutton/selectbutton.ts index cf4e3af3c40..8852954fb87 100755 --- a/src/app/components/selectbutton/selectbutton.ts +++ b/src/app/components/selectbutton/selectbutton.ts @@ -207,6 +207,9 @@ export class SelectButton implements ControlValueAccessor { if (selected) newValue = this.value.filter((val) => !ObjectUtils.equals(val, optionValue, this.equalityKey)); else newValue = this.value ? [...this.value, optionValue] : [optionValue]; } else { + if (selected && !this.allowEmpty) { + return; + } newValue = selected ? null : optionValue; }