Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

deeg
Copy link
Contributor

@deeg deeg commented Oct 24, 2016

Allows selection of empty item when focusFirst = false and focus is not on any options from the typeahead results.

Closes #877

/**
* The input target
*/
target: any;
Copy link
Contributor Author

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) {
Copy link
Contributor Author

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?

@deeg
Copy link
Contributor Author

deeg commented Nov 2, 2016

@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?

@pkozlowski-opensource
Copy link
Member

@deeg sorry for the delay. I'm batching several items for typeahead and will work on this early next week.

@pkozlowski-opensource
Copy link
Member

@deeg would you mind having a look at #877 (comment) ?

deeg added a commit to deeg/ng-bootstrap that referenced this pull request Nov 11, 2016
deeg added a commit to deeg/ng-bootstrap that referenced this pull request Nov 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants