-
Notifications
You must be signed in to change notification settings - Fork 13.4k
fix(checkbox): re-evaluate label visibility when label is updated #30980
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -15,6 +15,11 @@ import { ValueAccessorTestComponent } from "../value-accessor-test/value-accesso | |||||
| ] | ||||||
| }) | ||||||
| export class CheckboxComponent { | ||||||
| dynamicLabel = ''; | ||||||
|
|
||||||
| ngAfterViewChecked(): void { | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This is a test and normally I wouldn't make change requests to tests that are just kinda minor architecture changes, but |
||||||
| this.dynamicLabel = 'Dynamic Checkbox Label'; | ||||||
| } | ||||||
|
|
||||||
| form = this.fb.group({ | ||||||
| checkbox: [false, Validators.required], | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, we should avoid using inline anonymous functions in templates. Doing this both creates a new anonymous function on every render and can make debugging trickier (anonymous functions are harder to find in stack traces than named functions).
It would be better to declare an
onSlotChangefunction in the component and use it here.