Skip to content

Commit

Permalink
Merge pull request #61 from bithost-gmbh/bugfix/55-reset-button-not-w…
Browse files Browse the repository at this point in the history
…orking-clearserchinput

#55: Fix Clearing the search input by clicking the clear icon not wor…
  • Loading branch information
macjohnny authored Sep 26, 2018
2 parents 022618b + 6327961 commit 8eaf5b5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
## 1.4.0
* Enhancement: Tested and update peer dependency compatibility to allow
`@angular/core`: `^7.0.0`, `@angular/cdk`: `^7.0.0`, `@angular/material`: `^7.0.0`
* Enhancement: Allow disabling initial focusing of the input field with `@Input() disableInitialFocus` [#47](https://github.com/bithost-gmbh/ngx-mat-select-search/issues/47)
* Enhancement: Allow disabling initial focusing of the input field with `@Input() disableInitialFocus`
[#47](https://github.com/bithost-gmbh/ngx-mat-select-search/issues/47)
* Bugfix: Clearing the search input by clicking the clear icon did not work with `[clearSearchInput]="false"`
[#55](https://github.com/bithost-gmbh/ngx-mat-select-search/issues/55)

Thanks to @ofriedrich for reporting

## 1.3.1
* Bugfix: Error thrown when used together with `*ngIf` [#53](https://github.com/bithost-gmbh/ngx-mat-select-search/issues/53)
Expand Down
10 changes: 5 additions & 5 deletions src/app/mat-select-search/mat-select-search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ export class MatSelectSearchComponent implements OnInit, OnDestroy, AfterViewIni
}
} else {
// clear it when closing
this._reset();
if (this.clearSearchInput) {
this._reset();
}
}
});

Expand Down Expand Up @@ -322,10 +324,8 @@ export class MatSelectSearchComponent implements OnInit, OnDestroy, AfterViewIni
if (!this.searchSelectInput) {
return;
}
if (this.clearSearchInput) {
this.searchSelectInput.nativeElement.value = '';
this.onInputChange('');
}
this.searchSelectInput.nativeElement.value = '';
this.onInputChange('');
if (focus) {
this._focus();
}
Expand Down

0 comments on commit 8eaf5b5

Please sign in to comment.