From f857a70c45bac3961f4d3d87d93044d9fc66a49d Mon Sep 17 00:00:00 2001 From: Dilyana Yarabanova <45598235+didimmova@users.noreply.github.com> Date: Mon, 18 Nov 2024 10:20:14 +0200 Subject: [PATCH] fix(radio): remove label part when there's no text in the slot (#1482) --- src/components/radio/radio.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/radio/radio.ts b/src/components/radio/radio.ts index 02d718142..9e535af72 100644 --- a/src/components/radio/radio.ts +++ b/src/components/radio/radio.ts @@ -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); });