-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 - Change Detection - Not working #536
Comments
@webdev48 This looks like an issue in ng2-bootstrap. I will take a look. |
Finishing last bit and will publish @Dinistro 's fix for it today |
This "fix" actually causes problems in our case. We need to select "onKeyDown enter". To achieve this, we manually invoke this.typeaheadInstance._container.selectActiveMatch() (Template: #typeaheadInstance="bs-typeahead"). I expect the event listener typeaheadOnSelect(...) to be called. This works "onItemClick" but not in the self-implemented ENTER-Case (selectActiveMatch). The same issue exists by leaving "onKeyDown(tab"). If I temporarily remove the setTimeout in the typeahead-container.component.ts the selection by enter works fine and the typeaheadOnSelect is invoked as expected. Even the "tab" works well. What am I doing wrong? Is there a known fix? Thanks in advance! |
Trying to use ng2-boostrap typeahead and trying to clear the model on selection of a suggestion.
in component
the typeahead search box is never cleared even when I am doing this.selected='' . In Angular 1, people solved it in some weird ways: http://stackoverflow.com/questions/22104498/how-to-clear-text-from-angularui-typeahead-input/26793276#26793276
Is this a Angular 2 bug or a ng2-boostrap issue ? Why is change detection not fired ?
Here is a Plnkr to demonstrate the problem:
http://plnkr.co/edit/VWwrMDzISfwfEfwvn1f5?p=preview
The text was updated successfully, but these errors were encountered: