fix radio group when value is a number; fixes #924 (#960)

This commit is contained in:
Cory LaViska
2025-05-21 13:32:16 -04:00
committed by GitHub
parent 074c7a16d6
commit 2182d3c692
2 changed files with 3 additions and 5 deletions

View File

@@ -15,6 +15,7 @@ During the alpha period, things might break! We take breaking changes very serio
## Next
- 🚨 BREAKING: Renamed the `classic` theme to `shoelace`
- Fixed a bug in `<wa-radio-group>` that caused radios to uncheck when assigning a numeric value [issue:924]
## 3.0.0-alpha.13

View File

@@ -92,11 +92,8 @@ export default class WaRadioGroup extends WebAwesomeFormAssociatedElement {
/** The current value of the radio group, submitted as a name/value pair with form data. */
@state()
set value(val: string | null) {
if (this._value === val) {
return;
}
set value(val: string | number | null) {
if (typeof val === 'number') val = String(val);
this.valueHasChanged = true;
this._value = val;
}