-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(typeahead): allow selection of null item #958
Conversation
/** | ||
* The input target | ||
*/ | ||
target: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't sure if you were trying to avoid this, but it would be nice to have access to the input for the select event to be able to call blur, etc.
@@ -187,6 +192,12 @@ export class NgbTypeahead implements ControlValueAccessor, | |||
|
|||
handleKeyDown(event: KeyboardEvent) { | |||
if (!this._windowRef) { | |||
if (event.which === Key.Enter) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not want to do it for tab also, since I would still want tab to move focus to the next focusable item.
I'm not sure I would ever really want tab to select an item from the autocomplete. Maybe this is something we can make configurable in the future?
c39df65
to
26cdb1f
Compare
@pkozlowski-opensource, am I missing anything for this to get started being reviewed? Mind if I get a needs review tag so someone can take a look when they have time? |
@deeg sorry for the delay. I'm batching several items for typeahead and will work on this early next week. |
@deeg would you mind having a look at #877 (comment) ? |
Closes ng-bootstrap#958 Closes ng-bootstrap#877 Closes ng-bootstrap#980 Closes ng-bootstrap#1032
Allows selection of empty item when focusFirst = false and focus is not on any options from the typeahead results.
Closes #877