perf(): prevent unnecesary event listener changes

This commit is contained in:
Manu Mtz.-Almeida
2018-10-09 16:03:14 -05:00
parent 545db2e4c4
commit a999c1f0a9
9 changed files with 82 additions and 86 deletions

View File

@ -425,15 +425,15 @@ export class Select implements ComponentInterface {
return overlay.dismiss();
}
onKeyUp() {
private onKeyUp = () => {
this.keyFocus = true;
}
onFocus() {
private onFocus = () => {
this.ionFocus.emit();
}
onBlur() {
private onBlur = () => {
this.keyFocus = false;
this.ionBlur.emit();
}
@ -500,9 +500,9 @@ export class Select implements ComponentInterface {
aria-expanded={this.isExpanded ? 'true' : null}
aria-disabled={this.disabled ? 'true' : null}
onClick={this.open.bind(this)}
onKeyUp={this.onKeyUp.bind(this)}
onFocus={this.onFocus.bind(this)}
onBlur={this.onBlur.bind(this)}
onKeyUp={this.onKeyUp}
onFocus={this.onFocus}
onBlur={this.onBlur}
class="select-cover"
>
<slot></slot>