diff --git a/src/elements/radio-button/radio-button-group/radio-button-group.spec.ts b/src/elements/radio-button/radio-button-group/radio-button-group.spec.ts index ce278fb0e3..c943cfa02e 100644 --- a/src/elements/radio-button/radio-button-group/radio-button-group.spec.ts +++ b/src/elements/radio-button/radio-button-group/radio-button-group.spec.ts @@ -71,13 +71,13 @@ import '../radio-button-panel.js'; expect(element.value).to.be.equal(radio.value); }); - it('should respect disabled radio in value getter', async () => { + it('should ignore disabled radios', async () => { const radio = radios[0]; radio.checked = true; radio.disabled = true; await waitForLitRender(element); - expect(element.value).to.be.equal('Value one'); + expect(element.value).to.be.null; }); it('should update disabled on children', async () => { diff --git a/src/elements/radio-button/radio-button-group/radio-button-group.ts b/src/elements/radio-button/radio-button-group/radio-button-group.ts index 5a2665fb20..84ea4bd729 100644 --- a/src/elements/radio-button/radio-button-group/radio-button-group.ts +++ b/src/elements/radio-button/radio-button-group/radio-button-group.ts @@ -69,7 +69,7 @@ class SbbRadioButtonGroupElement extends SbbDisabledMixin(LitElement) { } } public get value(): string | null { - return this.radioButtons.find((r) => r.checked)?.value ?? this._fallbackValue; + return this.radioButtons.find((r) => r.checked && !r.disabled)?.value ?? this._fallbackValue; } /** * Used to preserve the `value` in case the radios are not yet 'loaded'