Skip to content

Commit

Permalink
fix(radio): remove label part when there's no text in the slot (#1482)
Browse files Browse the repository at this point in the history
  • Loading branch information
didimmova authored Nov 18, 2024
1 parent 2bd65b6 commit f857a70
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/radio/radio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ export default class IgcRadioComponent extends FormAssociatedCheckboxRequiredMix

protected override createRenderRoot() {
const root = super.createRenderRoot();
this.hideLabel = isEmpty(this.label);

root.addEventListener('slotchange', () => {
this.hideLabel = isEmpty(this.label);
});
Expand Down

0 comments on commit f857a70

Please sign in to comment.