mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 18:54:11 +08:00
perf(): prevent unnecesary event listener changes
This commit is contained in:
@ -99,19 +99,19 @@ export class Checkbox implements ComponentInterface {
|
||||
});
|
||||
}
|
||||
|
||||
private onChange() {
|
||||
private onChange = () => {
|
||||
this.checked = !this.checked;
|
||||
}
|
||||
|
||||
private onKeyUp() {
|
||||
private onKeyUp = () => {
|
||||
this.keyFocus = true;
|
||||
}
|
||||
|
||||
private onFocus() {
|
||||
private onFocus = () => {
|
||||
this.ionFocus.emit();
|
||||
}
|
||||
|
||||
private onBlur() {
|
||||
private onBlur = () => {
|
||||
this.keyFocus = false;
|
||||
this.ionBlur.emit();
|
||||
}
|
||||
@ -140,10 +140,10 @@ export class Checkbox implements ComponentInterface {
|
||||
type="checkbox"
|
||||
id={this.inputId}
|
||||
aria-labelledby={this.labelId}
|
||||
onChange={this.onChange.bind(this)}
|
||||
onFocus={this.onFocus.bind(this)}
|
||||
onBlur={this.onBlur.bind(this)}
|
||||
onKeyUp={this.onKeyUp.bind(this)}
|
||||
onChange={this.onChange}
|
||||
onFocus={this.onFocus}
|
||||
onBlur={this.onBlur}
|
||||
onKeyUp={this.onKeyUp}
|
||||
checked={this.checked}
|
||||
name={this.name}
|
||||
value={this.value}
|
||||
|
Reference in New Issue
Block a user