-
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 doesnt work properly in component set to ChangeDetectionStrategy.OnPush #1177
Comments
hm, had to check this out |
Same behavior for RadioButton (btnRadio) directive. |
I had the same issue, im using redux for state management, so my typeahead data is just array and is being updated each time after user keys in, The issue is when using on push strategy options are not updated, they are loaded but the visible options list is updated only after user type in. so lets say user type in : They are hidden until he types in Ab. After removal of onPush, it works fine. |
Hi, could you reproduce this issue in plunkr/stackblitz? |
@IlyaSurmay I no longer have this issue using 2.0.0-beta.8. I believe it was fixed for me at least some time ago but couldn't say exactly which version |
If typeaheads are used in a component with changeDetection set to ChangeDetectionStrategy.OnPush the typeaheads dont behave properly. i.e. The UI is not always (e.g. on initial click) updated when the dropdown should be appearing. This problem only occurs when parent is set to ChangeDetectionStrategy.OnPush. When that is removed everything works as expected.
See #563 and its fix #566 which is likely exactly the same thing needed here. Perhaps call changeDetector.markForCheck() in both show() and hide()?
my work around for now is to call markForCheck whenever typeaheadLoading is fired :(
The text was updated successfully, but these errors were encountered: