fix(angular): apply validation classes properly

* fix(angular): add validation classes to ion-item

* fix(inputs): focus handling

fixes #17171
fixes #16052
fixes #15572
fixes #16452
fixes #17063
This commit is contained in:
Manu MA
2019-01-19 22:56:00 +01:00
committed by GitHub
parent 7832be3f1c
commit 2b4d7b7be9
14 changed files with 241 additions and 74 deletions

View File

@ -15,6 +15,7 @@ import { createColorClasses, hostContext } from '../../utils/theme';
export class Checkbox implements ComponentInterface {
private inputId = `ion-cb-${checkboxIds++}`;
private buttonEl?: HTMLElement;
@Element() el!: HTMLElement;
@ -98,9 +99,16 @@ export class Checkbox implements ComponentInterface {
@Listen('click')
onClick() {
this.setFocus();
this.checked = !this.checked;
}
private setFocus() {
if (this.buttonEl) {
this.buttonEl.focus();
}
}
private onFocus = () => {
this.ionFocus.emit();
}
@ -146,6 +154,7 @@ export class Checkbox implements ComponentInterface {
onFocus={this.onFocus}
onBlur={this.onBlur}
disabled={this.disabled}
ref={el => this.buttonEl = el}
>
</button>
];