Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

fix(positioning): wait for animation to complete - #1595

Merged
aaronroberson merged 2 commits into
angular-ui:masterfrom
darrinholst:1593-position-up
May 31, 2016
Merged

aaronroberson merged 2 commits into
angular-ui:masterfrom
darrinholst:1593-position-up

Conversation

@darrinholst

Copy link
Copy Markdown
Contributor

When calculating the dropdown position the height of the dropdown
needs to be known. When using ngAnimate the animation has not
finished by the time the height calculation is needed. This fix
extracts the positioning calculation out to a function that is
called after animation is done (or immediately when animation is
not in use).

Fixes #1593.

@user378230

Copy link
Copy Markdown
Contributor

Thanks @darrinholst, any chance you could update the plunkr in the linked issue with your fixed version of select.js so we can test?

@darrinholst

Copy link
Copy Markdown
Contributor Author

It's been updated. http://plnkr.co/edit/MciJN9nVXf8lZIuOM0wj?p=preview

@user378230

Copy link
Copy Markdown
Contributor

Cheers @darrinholst

The only thing I noticed is that when you click out from an "up" dropdown, it flickers the dropdown in the "down" position before the dropdown disappears. (Chrome)

This doesn't happen without ngAnimate, any chance you might be able to look into it? Thanks for the work so far :)

@darrinholst

Copy link
Copy Markdown
Contributor Author

Yep, I noticed that too, but it feels like a separate issue than positioning not working. I can look into it, but I feel like it shouldn't hold up this fix. Thoughts?

@user378230

Copy link
Copy Markdown
Contributor

Hmm ok.

I wonder, does #1594 help at all?

@user378230

Copy link
Copy Markdown
Contributor

I'll review this in more depth and test locally along with #1594 and hopefully get them merged in soon. Thanks for your work.

When calculating the dropdown position the height of the dropdown
needs to be known. When using ngAnimate the animation has not
finished by the time the height calculation is needed. This fix
extracts the positioning calculation out to a function that is
called after animation is done (or immediately when animation is
not in use).

Fixes #1593.
When the dropdown is in an up position and it is closed we were
removing the positioning before hiding it which caused a flicker
while it moved down to it's natural bottom position. This change
sets the opacity to 0 before resetting the positioning style
attributes.
@darrinholst

Copy link
Copy Markdown
Contributor Author

#1594 didn't help the flicker when closing the dropdown. I fixed it in this branch though. Plunkr has been updated.

@aaronroberson
aaronroberson merged commit 8c4d1bf into angular-ui:master May 31, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

position up doesn't work with ngAnimate

3 participants