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

typeahead: not selecting on click #403

Closed
rob-myers opened this issue Apr 13, 2016 · 2 comments
Closed

typeahead: not selecting on click #403

rob-myers opened this issue Apr 13, 2016 · 2 comments

Comments

@rob-myers
Copy link

Partial typing and pressing Enter works, but clicking on an item has no effect.

Can be verified at the typeahead demo i.e. http://valor-software.com/ng2-bootstrap/#typeahead

@rbaarsma
Copy link
Contributor

👍

The problem seems to lie in the onBlur() event. I guess it fires simultanously and inside the hide() function the container gets disposed().

For now I've hotfixed it in the pull request with a timeout, which is not really noticable, but does fix the issue and allowing the click event to fire first as intended.

  // typeahead.directive.ts

  @HostListener('blur', ['$event.target'])
  protected onBlur(target:any):void {
    setTimeout(() => this.hide(), 250);
  }

If anyone has a better solution feel free to implement, but this is an annoying and breaking bug, so it would be great if this pull request can be merged asap.

@slintes
Copy link
Contributor

slintes commented Apr 13, 2016

this is fixed already, see #363 and #398

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants