Skip to content

Commit

Permalink
Merge pull request #109 from bithost-gmbh/bugfix/107-no-entries-found
Browse files Browse the repository at this point in the history
avoid no entries found class when opening the select panel
  • Loading branch information
macjohnny authored Feb 28, 2019
2 parents 84f20b1 + df72b86 commit fa670ac
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.5.3
* Bugfix: Avoid space when opening select panel after previously showing "no entries found" message when placing `<ngx-mat-select-search>` inside a `<mat-option>` element
[#107](https://github.com/bithost-gmbh/ngx-mat-select-search/issues/107)

Thanks to @aroblu94 for reporting

## 1.5.2
* Bugfix: Show "no entries found" message when placing `<ngx-mat-select-search>` inside a `<mat-option>` element
[#101](https://github.com/bithost-gmbh/ngx-mat-select-search/issues/101)
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ngx-mat-select-search",
"description": "Library that provides an angular component providing an input field for searching / filtering MatSelect options of the Angular Material library.",
"version": "1.5.2",
"version": "1.5.3",
"license": "MIT",
"scripts": {
"ng": "ng",
Expand Down
6 changes: 5 additions & 1 deletion src/app/mat-select-search/mat-select-search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class MatSelectSearchComponent implements OnInit, OnDestroy, AfterViewIni


constructor(@Inject(MatSelect) public matSelect: MatSelect,
private changeDetectorRef: ChangeDetectorRef,
public changeDetectorRef: ChangeDetectorRef,
@Optional() @Inject(MatOption) public matOption: MatOption = null) {


Expand Down Expand Up @@ -359,6 +359,10 @@ export class MatSelectSearchComponent implements OnInit, OnDestroy, AfterViewIni
}
this.searchSelectInput.nativeElement.value = '';
this.onInputChange('');
if (this.matOption && !focus) {
// remove no entries found class on mat option
this.matOption._getHostElement().classList.remove('mat-select-search-no-entries-found');
}
if (focus) {
this._focus();
}
Expand Down

0 comments on commit fa670ac

Please sign in to comment.