Skip to content

Commit

Permalink
fix(typeahead): bring focus back to input on item click
Browse files Browse the repository at this point in the history
Closes #2805
Fixes #2792
  • Loading branch information
fbasso authored and maxokorokov committed Oct 18, 2018
1 parent 67651be commit 2b3c898
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion e2e-app/e2e/src/typeahead/typeahead-focus.e2e-spec.ts
Expand Up @@ -30,7 +30,7 @@ describe('Typeahead', () => {

await page.getDropdownItems().get(0).click();
expectTypeaheadValue('Alabama');
// expectTypeaheadFocused();
expectTypeaheadFocused();
});

it(`should be open after a second click`, async() => {
Expand Down
1 change: 1 addition & 0 deletions src/typeahead/typeahead.ts
Expand Up @@ -308,6 +308,7 @@ export class NgbTypeahead implements ControlValueAccessor,
private _selectResultClosePopup(result: any) {
this._selectResult(result);
this._closePopup();
this._elementRef.nativeElement.focus();
}

private _showHint() {
Expand Down

0 comments on commit 2b3c898

Please sign in to comment.