Skip to content

Fix list view drop direction updates #415

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

Merged

Conversation

jjlangholtz
Copy link
Contributor

In #setDropMenuLocation, the bounding rectangle for the menu was being
calculated before it was rendered causing the height to be 0.

For some reason the $timeout was not waiting for the digest cycle to
complete, however, adding a 100 ms delay consistently drops the menu in
the proper direction.

Fixes #399

In #setDropMenuLocation, the bounding rectangle for the menu was being
calculated before it was rendered causing the height to be 0.

For some reason the $timeout was not waiting for the digest cycle to
complete, however, adding a 100 ms delay consistently drops the menu in
the proper direction.

Fixes patternfly#399
Copy link
Member

@jeff-phillips-18 jeff-phillips-18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@bleathem
Copy link
Member

Rather than using a timeout to "hopefully" get the timing correct, is there another event we can be listening for to ensure the rendering is complete before calculating the bounding rectangle?

@bleathem
Copy link
Member

How about triggering a digest cycle in a requestanimationframe listener? Might that get us the post-render timing we are looking for?

@jjlangholtz
Copy link
Contributor Author

Thanks for the suggestion @bleathem, just tested it out and it seems to be working great.

@bleathem
Copy link
Member

Great, glad to hear it worked. I will point out that the requestanimationframe listener will be invoked outside of the digest loop. You might want to consider nesting a $scope.apply, or $timeout to get back into it. If that's not a concern then I'm ok with this approach as it is.

@bleathem
Copy link
Member

We should update the title of this PR before merging, to make sure the correct description gets into the release notes.

@jjlangholtz can you open a parallel PR ro the branch-4.0-dev branch to update the 4.0 component?

@jjlangholtz jjlangholtz changed the title Add explicit $timeout delay for determining drop direction Fix list view drop direction updates Feb 22, 2017
jjlangholtz added a commit to jjlangholtz/angular-patternfly that referenced this pull request Feb 22, 2017
@jeff-phillips-18 jeff-phillips-18 merged commit 95bd2a1 into patternfly:master Feb 22, 2017
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.

3 participants