From a4f1563a39d50f49e821b8cac9835927b551748c Mon Sep 17 00:00:00 2001 From: Madalena Campos Date: Wed, 12 Jul 2023 11:35:39 -0300 Subject: [PATCH] fix: function adjustments #734 --- projects/ion/src/lib/chip-group/chip-group.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/ion/src/lib/chip-group/chip-group.component.ts b/projects/ion/src/lib/chip-group/chip-group.component.ts index 628f13ed0..f38a03abd 100644 --- a/projects/ion/src/lib/chip-group/chip-group.component.ts +++ b/projects/ion/src/lib/chip-group/chip-group.component.ts @@ -30,17 +30,19 @@ export class IonChipGroupComponent { if (chipSelected.multiple && chipSelected.selected) { return; } + const isChipSelected = chipSelected.selected; + if (!this.multiple) { this.clearChips(); } + if (!chipSelected.multiple || !isChipSelected) { chipSelected.selected = !isChipSelected; } if (this.required) { this.checkRequired(chipSelected); - return; } this.selected.emit(chipSelected);