From cf223e40c19ad12d2ee0c2f9c1964dbf5d3d5154 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Wed, 25 Sep 2019 13:06:17 -0400 Subject: [PATCH] fix(radio-group): get radios before caching value to avoid infinite loop (#19448) fixes #19277 --- core/src/components/radio-group/radio-group.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/components/radio-group/radio-group.tsx b/core/src/components/radio-group/radio-group.tsx index 9c5febc30a4..3564bc3eda9 100644 --- a/core/src/components/radio-group/radio-group.tsx +++ b/core/src/components/radio-group/radio-group.tsx @@ -83,8 +83,14 @@ export class RadioGroup implements ComponentInterface { } private async updateRadios() { - const { value } = this; + /** + * Make sure we get all radios first + * so values are up to date prior + * to caching the radio group value + */ const radios = await this.getRadios(); + const { value } = this; + let hasChecked = false; // Walk the DOM in reverse order, since the last selected one wins!