After completing an Angular course on Udemy, I decided to implement a custom checkbox in my Angular app. However, I encountered an issue where the UI was not updating properly when using checkAll and uncheckAll functions after the user interacted with an individual checkbox.
You can view my implementation on StackBlitz
Here are some of the things I have tried to solve the issue:
- Utilizing a timeout (mainly for autofocus)
- Using ChangeDetectorRef detectChanges()
- Experimenting with template forms, although tr/tbody rendering proved problematic even when wrapped
- Attempting to use reactive forms, though unsure if implemented correctly
To replicate the problem, follow these steps:
- Click on any checkbox except the first one.
- Try clicking on the first checkbox for checkAll or uncheckAll functionality - note that it does not affect the checkbox clicked in the initial step.