Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(radio): persist checked state when items are updated in radio-group #29457

Merged
merged 3 commits into from
May 6, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions core/src/components/radio/radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@ export class Radio implements ComponentInterface {
*/
@Event() ionBlur!: EventEmitter<void>;

componentDidLoad() {
/**
* The value may be `undefined` if the it
thetaPC marked this conversation as resolved.
Show resolved Hide resolved
* gets set before the radio is
* rendered. This ensures that the radio
* is checked if the value matches. This
* happens most often when Angular is
* rendering the radio.
*/
this.updateState();
}

/** @internal */
@Method()
async setFocus(ev: globalThis.Event) {
Expand Down