Skip to content

Commit

Permalink
fixes #413
Browse files Browse the repository at this point in the history
* destroy useless listen

* set listen handler to null after invoken it
  • Loading branch information
10222927 authored and rdkmaster committed Dec 24, 2017
1 parent 6f94010 commit ff9933f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/jigsaw/component/select/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ export class JigsawSelect extends AbstractJigsawComponent implements ControlValu
if (this._$optionListHidden) {
this._documentListen();
} else {
this._documentListen = this._renderer.listen('document', 'click', () => this._$optionListHidden = true);
this._documentListen = this._renderer.listen('document', 'click', () => {
this._$optionListHidden = true;
this._documentListen();
this._documentListen = null;
});
}
}

Expand Down

0 comments on commit ff9933f

Please sign in to comment.