Skip to content

Commit

Permalink
fix: function adjustments #734
Browse files Browse the repository at this point in the history
  • Loading branch information
MadalenaCampos committed Jul 12, 2023
1 parent a4f1563 commit f956a26
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions projects/ion/src/lib/chip-group/chip-group.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export class IonChipGroupComponent {
this.clearChips();
}

if (!chipSelected.multiple || !isChipSelected) {
const isSingleOrSelectedChip = !chipSelected.multiple || !isChipSelected;

if (isSingleOrSelectedChip) {
chipSelected.selected = !isChipSelected;
}

Expand All @@ -48,7 +50,7 @@ export class IonChipGroupComponent {
this.selected.emit(chipSelected);
}

checkRequired(chipSelected: ChipInGroup) {
checkRequired(chipSelected: ChipInGroup): void {
const selectedChips = this.chips.filter((chip) => chip.selected);
if (!selectedChips.length) {
chipSelected.selected = true;
Expand Down

0 comments on commit f956a26

Please sign in to comment.