From 2182d3c692cef29b27f20c775bdc61236cb94483 Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Wed, 21 May 2025 13:32:16 -0400 Subject: [PATCH] fix radio group when value is a number; fixes #924 (#960) --- docs/docs/resources/changelog.md | 1 + src/components/radio-group/radio-group.ts | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/docs/resources/changelog.md b/docs/docs/resources/changelog.md index b281dd360..c1806e33d 100644 --- a/docs/docs/resources/changelog.md +++ b/docs/docs/resources/changelog.md @@ -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 `` that caused radios to uncheck when assigning a numeric value [issue:924] ## 3.0.0-alpha.13 diff --git a/src/components/radio-group/radio-group.ts b/src/components/radio-group/radio-group.ts index 3eee6b8fd..e0b84acab 100644 --- a/src/components/radio-group/radio-group.ts +++ b/src/components/radio-group/radio-group.ts @@ -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; }