fix(many): disabled control in item does not receive active/hover states (#26867)

Resolves #26706
This commit is contained in:
octicon-git-branch(16/)
octicon-tag(16/)
Sean Perkins
2023-03-14 10:32:55 -04:00
committed by GitHub
gitea-unlock(16/)
parent ef33270b55
commit f829672a6a
octicon-diff(16/tw-mr-1) 6 changed files with 73 additions and 31 deletions

19
core/src/components/radio/radio.tsx
View File

@@ -164,16 +164,23 @@ export class Radio implements ComponentInterface {
}
}
@Watch('color')
@Watch('checked')
@Watch('color')
@Watch('disabled')
emitStyle() {
protected styleChanged() {
this.emitStyle();
}
private emitStyle() {
const style: StyleEventDetail = {
'interactive-disabled': this.disabled,
};
if (this.legacyFormController.hasLegacyControl()) {
this.ionStyle.emit({
'radio-checked': this.checked,
'interactive-disabled': this.disabled,
});
style['radio-checked'] = this.checked;
}
this.ionStyle.emit(style);
}
private updateState = () => {

11
core/src/components/radio/test/item/index.html
View File

@@ -154,6 +154,17 @@
</ion-list>
</div>
</div>
<h1>States</h1>
<div class="grid">
<ion-list>
<ion-radio-group>
<ion-item>
<ion-radio disabled="true">Enable Notifications</ion-radio>
</ion-item>
</ion-radio-group>
</ion-list>
</div>
</ion-content>
</ion-app>
</body>