2

I am not UI/UX person and I need help with setting radio button as checked when used in a LWC inner template-for-loop which involves page navigation and conditional rendering. I am able to get the selected value in my JS controller, but when I navigate back to the previous page, the "checked" property is not retaining although I still have the selected value. It might be easy to understand if you can look at the sample here:- Sample

The reason I went with custom component for radio group is due to applying CSS to individual radio input.

Any help is appreciated. Thank you!

1 Answer 1

3

You have to bind the checked attribute of the radio group to your data (e. g. via adding a checked property to your options object) in order to keep track of the selected dom element.

Updated your example here

1
  • Awesome. Thanks so much!!
    – malu
    Aug 8, 2019 at 1:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .