Skip to content

Commit 1adeb46

Browse files
authored
fix(lion-radio-group): handle unchecked state
1 parent 41e12da commit 1adeb46

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/radio-group/src/LionRadioGroup.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,17 @@ export class LionRadioGroup extends LionFieldset {
3535
}
3636

3737
get serializedValue() {
38-
return this._getCheckedRadioElement().serializedValue;
38+
const el = this._getCheckedRadioElement();
39+
return el ? el.serializedValue : '';
3940
}
4041

4142
set serializedValue(value) {
4243
this._setCheckedRadioElement(value, (el, val) => el.serializedValue === val);
4344
}
4445

4546
get formattedValue() {
46-
return this._getCheckedRadioElement().formattedValue;
47+
const el = this._getCheckedRadioElement();
48+
return el ? el.formattedValue : '';
4749
}
4850

4951
set formattedValue(value) {

0 commit comments

Comments
 (0)