Skip to content

Commit

Permalink
fix: prevent rendering of empty label
Browse files Browse the repository at this point in the history
Close #23
  • Loading branch information
paodb authored and javier-godoy committed Oct 4, 2024
1 parent 4b1216d commit 729ad27
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ export class BadgeList extends ResizeMixin(ThemableMixin(LitElement)) {
margin: var(--badge-list-badges-margin);
}
:host(:not([has-label])) [part='label']{
display:none;
}
[part="label"] {
align-self: flex-start;
color: var(--badge-list-label-color);
Expand Down Expand Up @@ -230,5 +234,12 @@ export class BadgeList extends ResizeMixin(ThemableMixin(LitElement)) {
</div>
`;
}

update(_changedProperties: Map<PropertyKey, unknown>) {
if (_changedProperties.has('label')) {
this.toggleAttribute('has-label', this.label != null);
}
super.update(_changedProperties);
}

}

0 comments on commit 729ad27

Please sign in to comment.