Radio button works incorrectly when patch from value #9801
-
I am attaching a vuideo but it is some kind of tick missing because when i path from value (after 2 seconds as you can see in source code) radio button value changes but animation is not played until the end. It is enough for me click anywhere on the screen and animation is completed. Any ideas why it could happen? Screen.Recording.2024-11-20.at.11.35.44.mov |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
I have done few thing during my investigation. I had extracted code with form to seperate component and added this component over existing radio buttons. It looks and works different. First off all ther is no data-appearance="primary" on radiobuttons inside of extracted component but there on screen radio buttons. Second thing that in extracted component there is white big circle of ::before. Any ideas why? But animation is capable to play fully code of extracted component: @component({
} ` `
{{ 'appeal-edit.doNotPrintDepartmentName' | translate }}
{{ 'appeal-edit.printDepartmentName' | translate }}
{{ 'appeal-edit.printDepartmentNameCustom' | translate }}
` Screen.Recording.2024-11-20.at.11.59.13.mov |
Beta Was this translation helpful? Give feedback.
In your stackblitz when I add markForCheck it fixes the issue. As it is it is working as expected, without notifying Angular change detection while doing async operations in OnPush all sorts of different issues might pop up — this is not the correct usage.
It works part-way because Angular imperatively updates state of the checkbox without notifying change detection, so styles that depend on CSS
:checked
are applied, but some other things rely on bindings that are not updated because nothing has notified the view that change detection must be ran.In other words, either use default change detection strategy, or use OnPush properly. If your state management calls markForCheck it must be ca…