Skip to content

Commit e6842d2

Browse files
committed
fix(checkbox): apply PR feedback
1 parent 22eed89 commit e6842d2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

core/src/components/checkbox/checkbox.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ export class Checkbox implements ComponentInterface {
265265
ev.stopPropagation();
266266
};
267267

268+
private onSlotChange = () => {
269+
forceUpdate(this)
270+
}
271+
268272
private getHintTextId(): string | undefined {
269273
const { helperText, errorText, helperTextId, errorTextId, isInvalid } = this;
270274

@@ -382,7 +386,7 @@ export class Checkbox implements ComponentInterface {
382386
id={this.inputLabelId}
383387
onClick={this.onDivLabelClick}
384388
>
385-
<slot onSlotchange={() => forceUpdate(this)}></slot>
389+
<slot onSlotchange={this.onSlotChange}></slot>
386390
{this.renderHintText()}
387391
</div>
388392
<div class="native-wrapper">

packages/angular/test/base/src/app/standalone/value-accessors/checkbox/checkbox.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { ValueAccessorTestComponent } from "../value-accessor-test/value-accesso
1717
export class CheckboxComponent {
1818
dynamicLabel = '';
1919

20-
ngAfterViewChecked(): void {
20+
ngAfterViewInit(): void {
2121
this.dynamicLabel = 'Dynamic Checkbox Label';
2222
}
2323

0 commit comments

Comments
 (0)