Skip to content

Commit

Permalink
refactor: initRole logic
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardh-landg committed May 9, 2024
1 parent b2744a2 commit c33b262
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions projects/canopy/src/lib/alert/alert.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,13 @@ export class LgAlertComponent implements OnChanges {
if (this.explicitRole !== 'none') {
this.roleAttr = this.explicitRole;
}
} else if (this.variant === 'info' || this.variant === 'generic') {
this.roleAttr = null;
} else {
this.roleAttr = 'alert';
switch (this.variant) {
case 'error':
case 'warning':
case 'success':
this.roleAttr = 'alert';
}
}
}
}

0 comments on commit c33b262

Please sign in to comment.