diff --git a/core/src/components/checkbox/checkbox.tsx b/core/src/components/checkbox/checkbox.tsx index 74c703e328..7a2386f01a 100644 --- a/core/src/components/checkbox/checkbox.tsx +++ b/core/src/components/checkbox/checkbox.tsx @@ -150,23 +150,22 @@ export class Checkbox implements ComponentInterface { } @Watch('checked') - checkedChanged() { - this.emitStyle(); - } - @Watch('disabled') - disabledChanged() { + protected styleChanged() { this.emitStyle(); } - // TODO(FW-3100): remove this private emitStyle() { + const style: StyleEventDetail = { + 'interactive-disabled': this.disabled, + }; + + // TODO(FW-3100): remove this if (this.legacyFormController.hasLegacyControl()) { - this.ionStyle.emit({ - 'checkbox-checked': this.checked, - 'interactive-disabled': this.disabled, - }); + style['checkbox-checked'] = this.checked; } + + this.ionStyle.emit(style); } private setFocus() { diff --git a/core/src/components/checkbox/test/item/index.html b/core/src/components/checkbox/test/item/index.html index a0728df934..a1628f44bd 100644 --- a/core/src/components/checkbox/test/item/index.html +++ b/core/src/components/checkbox/test/item/index.html @@ -136,6 +136,18 @@ + +