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

fix(menu): trigger change detection after setting max-height #349

Merged
merged 1 commit into from
Apr 5, 2018
Merged

fix(menu): trigger change detection after setting max-height #349

merged 1 commit into from
Apr 5, 2018

Conversation

yggg
Copy link
Contributor

@yggg yggg commented Apr 5, 2018

To animate menu expanding we need to know height of all expoanded children.
Since children cann't be accessed before AfterViewInit hook, we have to calc
and set 'maxHeight' there, but it causing ExpressionChangedAfterItHasBeenCheckedError
error. Since 'maxHeight' can't be calculated earlier, we have to trigger change detection
again. This is a common workaround for this error.

Please read and mark the following check list before creating a pull request:

Short description of what this resolves:

Fix #263

To animate menu expanding we need to know height of all expoanded children.
Since children cann't be accessed before AfterViewInit hook, we have to calc
and set 'maxHeight' there, but it causing ExpressionChangedAfterItHasBeenCheckedError
error. Since 'maxHeight' can't be calculated earlier, we have to trigger change detection
again. This is a common workaround for this error.
@yggg yggg requested a review from nnixaa April 5, 2018 09:27
@nnixaa nnixaa merged commit 8c10372 into akveo:master Apr 5, 2018
@nnixaa
Copy link
Collaborator

nnixaa commented Apr 5, 2018

@yggg 👍

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

Successfully merging this pull request may close these issues.

Menu: error when navigating to page without menu and then back to previous page
2 participants