Closed olaf-k closed 3 months ago
Pretty much as it says on the tin 😁
Can be reproduced on https://explore.fast.design/components/fast-radio-group if you update the code snippet to add different values for each radio, or using the fast-foundation storybook:
→ In dev tools, the radiogroup's value is undefined as it should since nothing has been selected.
undefined
Select any radio button, say Grapefruit.
→ The radiogroup's value is grapefruit as it should.
grapefruit
Now remove the selected fast-radio from the DOM.
→ The radiogroup's value remains grapefruit while no radio is selected.
The radiogroup's value should be set to undefined.
Fix setupRadioButtons() to account for the case where this.value is set but does not match any of the radios'.
setupRadioButtons()
this.value
A good feasible solution here could be making the value member a getter. Same as form data
Unfortunately @microsoft/fast-foundation is being deprecated, refer to #6955.
@microsoft/fast-foundation
🐛 Bug Report
Pretty much as it says on the tin 😁
💻 Repro or Code Sample
Can be reproduced on https://explore.fast.design/components/fast-radio-group if you update the code snippet to add different values for each radio, or using the fast-foundation storybook:
→ In dev tools, the radiogroup's value is
undefined
as it should since nothing has been selected.Select any radio button, say Grapefruit.
→ The radiogroup's value is
grapefruit
as it should.Now remove the selected fast-radio from the DOM.
→ The radiogroup's value remains
grapefruit
while no radio is selected.🤔 Expected Behavior
The radiogroup's value should be set to
undefined
.💁 Possible Solution
Fix
setupRadioButtons()
to account for the case wherethis.value
is set but does not match any of the radios'.