fix(radio-group): emit value change on componentDidLoad #28488
Merged
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Issue number: resolves #28356
What is the current behavior?
ion-radio-groupwould not set the radio value when using it as a Angular standalone component and data binding:This is happening because the value is set before the value watcher has been configured. The event,
ionValueChange, does not get dispatched.What is the new behavior?
Run
valueChanged()incomponentDidLoad().valueChanged()function is tied to the value watcher so it will dispatch theionValueChange.Does this introduce a breaking change?
Other information
In our testing, we observed that the issue described below only occurs when assigning a value to the radio group within the primary content, such as rendering within the app component template.
When the template is isolated to a route, the value is assigned correctly. To address this issue, we need to ensure that the watcher is called after the component has finished loading, allowing the emit to be dispatched correctly.
Dev build: 7.5.4-dev.11699404450.136700d7