Skip to content

Commit

Permalink
fixup! (fix) in multi select mode after enter the search is not focus…
Browse files Browse the repository at this point in the history
  • Loading branch information
macjohnny committed Oct 17, 2020
1 parent 4562b0a commit 4c43b7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/mat-select-search/mat-select-search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR } from '@angular/f
import { _countGroupLabelsBeforeOption, MatOption } from '@angular/material/core';
import { MatSelect, SELECT_PANEL_MAX_HEIGHT } from '@angular/material/select';
import { MatFormField } from '@angular/material/form-field';
import { A, DOWN_ARROW, END, ESCAPE, HOME, NINE, SPACE, UP_ARROW, Z, ZERO, } from '@angular/cdk/keycodes';
import { A, DOWN_ARROW, END, ENTER, ESCAPE, HOME, NINE, SPACE, UP_ARROW, Z, ZERO, } from '@angular/cdk/keycodes';
import { ViewportRuler } from '@angular/cdk/scrolling';
import { LiveAnnouncer } from '@angular/cdk/a11y';
import { BehaviorSubject, combineLatest, Observable, of, Subject } from 'rxjs';
Expand Down Expand Up @@ -441,7 +441,7 @@ export class MatSelectSearchComponent implements OnInit, OnDestroy, ControlValue
event.stopPropagation();
}

if (this.matSelect.multiple && event.key && event.key === 'Enter') {
if (this.matSelect.multiple && event.key && event.keyCode === ENTER) {
// Regain focus after multiselect, so we can further type
setTimeout(() => this._focus());
}
Expand Down

0 comments on commit 4c43b7c

Please sign in to comment.