homerjam / angular-ui-router-anim-in-out

An animation directive to use with ngAnimate 1.2+ and ui-router
http://homerjam.github.io/angular-ui-router-anim-in-out/
234 stars 49 forks source link

View is not hidden before the transition #7

Closed rafaelbrotas closed 9 years ago

rafaelbrotas commented 9 years ago

I have a problem with the transition.

First is displaying a view and then the active view is hidden.

homerjam commented 9 years ago

Hi,

Do you have an example or any code you could show me?

Thanks

Ps. Another repo homerjam/angular-gsapify-router is better maintained now

Otanikotani commented 9 years ago

Hi,

I have the same problem. Here is a link http://plnkr.co/edit/uKskaP7Yepfai6zA6fQy - I tried to use your example here. When you click Page 1 and Page 2 buttons the previous view is moved down but still visible.

I simply added this to styles: .anim-in-out.anim-in-setup { display: none; } and it worked for me, but there must be more elegant solution.

homerjam commented 9 years ago

The solution here is to use absolute positioning on the view element - this is left to the user to configure so that its less opinionated and offers the flexibility to use fixed positioning etc.

gufigueiredo commented 9 years ago

Same problem here. The content is "moved down" before transition.

Otanikotami solution worked for me, but the IN transitions stopped to work.

Here is an updated plunker: http://plnkr.co/edit/9x5QXyR3EieG28IXToyJ?p=preview

Any workarounds?

homerjam commented 9 years ago

Try this:

.anim-in-out.anim-in-setup {
    position: absolute;
}

display: none; will break the transitions, the element must be "visible" for them to work

gufigueiredo commented 9 years ago

Worked like a charm! Very thank you!

gufigueiredo commented 9 years ago

PS: I've tried the new repo (angular-gsapify-router) and the same problem occurs. I don't know if is there any workarounds.

homerjam commented 9 years ago

Just add this line to your css

[ui-view] { position: absolute; }

mmaask commented 9 years ago

Setting position to absolute messes up bootstrap content container.

homerjam commented 9 years ago

I expect you can wrap the container in another element to avoid this problem. Feel free to post an example in plunkr/fiddle/codepen

mmaask commented 9 years ago

That would by my example: http://plnkr.co/edit/JBi9J23fja440E7GoPmR?p=preview

Added [ui-view] { position: absolute; }

homerjam commented 9 years ago

If you add position: relative; to the .content class/element it seems to resolve the problem

mmaask commented 9 years ago

Thanks for the solution, but for some reason some pages are still getting wrapped in containers. Registration page becomes like this when the middle input field is removed: http://plnkr.co/edit/JBi9J23fja440E7GoPmR?p=preview (added relative as html style for the testing purpose here)

homerjam commented 9 years ago

I don't think your problem relates to this issue I'm afraid. You'll find more help on the Twitter bootstrap page or Stack Overflow.