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 does not show complete using ChangeDetectionStrategy.OnPush #775

Closed
hongbo-miao opened this issue Sep 20, 2016 · 2 comments
Closed

Comments

@hongbo-miao
Copy link
Contributor

Bug description:

When using changeDetection: ChangeDetectionStrategy.OnPush, when you type 'a', it dose not show complete
image

Without changeDetection: ChangeDetectionStrategy.OnPush, it shows well
image

Link to minimally-working plunker that reproduces the issue:

http://plnkr.co/edit/2O0qQXE5c7CqLm5mfukF?p=preview

Version of Angular, ng-bootstrap, and Bootstrap:

  • Angular 2.0.0
  • ng-bootstrap 1.0.0-alpha.5
  • Bootstrap 4 Alpha 4
@pkozlowski-opensource
Copy link
Member

So this is kind of a corner / debatable case. In the plunk forked from the demo page we are using debounceTime(200) which is equivalent to setTimeout when it comes to change detection. Obviously the setTimout wouldn't be picked up by a component using changeDetection: ChangeDetectionStrategy.OnPush and debounceTime(200) falls into the same "non-working" scenario.

We could mark the result window for check when receiving data from the observable stream but I'm not sure we should...

For now the work-around is to either not mark the component as one using OnPush or droop debounceTime. I understand that this is not ideal but I want to sleep on this issue before rushing into any solutions....

@hongbo-miao
Copy link
Contributor Author

Nice catch! : )

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

Successfully merging a pull request may close this issue.

2 participants