Skip to content

Commit

Permalink
fix(chips): only emit selectedChange on actual changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gjdev committed Jun 20, 2018
1 parent a3a0a77 commit 5d509d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bundle/src/components/chips/mdc.chip.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ export class MdcChipDirective extends AbstractMdcRipple implements AfterContentI
addClass: (className: string) => {
let selectedChanged = className === 'mdc-chip--selected' && !this._elm.nativeElement.classList.contains(className);
this._renderer.addClass(this._elm.nativeElement, className);
if (this.selectedChange)
if (selectedChanged)
this.selectedChange.emit(true);
},
removeClass: (className: string) => {
let selectedChanged = className === 'mdc-chip--selected' && this._elm.nativeElement.classList.contains(className);
this._renderer.removeClass(this._elm.nativeElement, className);
if (this.selectedChange)
if (selectedChanged)
this.selectedChange.emit(false);
},
hasClass: (className) => this._elm.nativeElement.classList.contains(className),
Expand Down

0 comments on commit 5d509d1

Please sign in to comment.