Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Element with ng-show=false animates initially when it's in a bootstrap-ui modal #8812

Closed
Narretz opened this issue Aug 28, 2014 · 14 comments
Closed

Comments

@Narretz
Copy link
Contributor

Narretz commented Aug 28, 2014

This is a follow-up to #5262 It turns out that the issue I described is different from the original issue described. In my case, I have a ng-show animation inside a bootstrap-ui modal that is initially set to false. When the modal opens, however, the element is animated from shown to hidden, while it should simply be not shown. I have posted a workaround here: #5262 (comment)

@Narretz Narretz added this to the 1.3.0 milestone Aug 28, 2014
@matsko
Copy link
Contributor

matsko commented Sep 4, 2014

@Narretz did this by chance get fixed with RC0?

@Narretz
Copy link
Contributor Author

Narretz commented Sep 4, 2014

Nope, unfortunately it still happens: http://plnkr.co/edit/RcWCCktlLYonooUXNOnZ?p=preview

@caitp
Copy link
Contributor

caitp commented Sep 4, 2014

Looks like it's working to me: http://plnkr.co/edit/qPE3aAE6jJCvcvhtigZT?p=preview (wait, I might be wrong, hang on)

@caitp
Copy link
Contributor

caitp commented Sep 4, 2014

Okay yeah so it does still animate :( But @Narretz the plunker you linked was broken and didn't really demonstrate that :p

@Narretz
Copy link
Contributor Author

Narretz commented Sep 4, 2014

Thanks for checking @caitp
The plunker was frozen at the wrong version ... the ui for that is not that great.

@jeffbcross jeffbcross modified the milestones: 1.3.0-rc.5, 1.3.0 Sep 29, 2014
@IgorMinar
Copy link
Contributor

@caitp can you please look into this? repro with rc3: http://plnkr.co/edit/103bF0Ve4ioXkdCRONaS?p=preview

@caitp
Copy link
Contributor

caitp commented Oct 2, 2014

http://plnkr.co/edit/YCMZP41SnHLZke6sEeqy?p=preview I think this is basically the two cases we are looking at.

so, in the case of doing this with jQuery/raw DOM operations, I don't think there is much we can do --- but we still see the issue with ngAnimate's enter/leave being used too.

I think if classBasedAnimationsBlocked() (from ngAnimate) looked at parent elements as well as the current element, then we'd be able to fix the enter/leave case. I'm not sure why we're not doing that.

@matsko can you explain this quickly?

@caitp
Copy link
Contributor

caitp commented Oct 2, 2014

So matsko has said there are basically 2 options: bootstrap should be able to just disable animations on the modal, and then re-enable them shortly after (I tried to demonstrate this in my mini-repro, but I couldn't make it work --- it never re-enabled animations! but I was probably just doing it wrong).

Alternatively, something about making ng-animate-children more dynamic, so that a directive could wrap the temporary animation prevention nicely to be reused in many places.

Either of these seem like good solutions to this problem to me (well, moreso the first one if I can figure out how to make that work properly).

@IgorMinar
Copy link
Contributor

@caitp any luck with making the first solution work?

@btford btford modified the milestones: 1.3.0-rc.5, 1.3.0-rc.6 Oct 8, 2014
@caitp
Copy link
Contributor

caitp commented Oct 9, 2014

no, from what I've seen, re-enabling animations after disabling doesn't seem to have any effect on child elements

@Narretz
Copy link
Contributor Author

Narretz commented Oct 9, 2014

I might be missing something, but I don't think ng-animate-children should be part of the problem here. ui-bootstrap uses a custom transition handling that uses the original bootstrap styles.

@IgorMinar IgorMinar modified the milestones: 1.3.0-rc.6, 1.3.0 Oct 13, 2014
@tbosch tbosch modified the milestones: 1.3.x, 1.3.1 Oct 15, 2014
@jeffbcross jeffbcross modified the milestones: 1.3.1, 1.3.2 Oct 31, 2014
@caitp caitp assigned matsko and unassigned caitp Nov 5, 2014
@caitp caitp modified the milestones: 1.3.2, 1.3.3 Nov 7, 2014
@petebacondarwin petebacondarwin modified the milestones: 1.3.3, 1.3.x Nov 10, 2014
@petebacondarwin
Copy link
Contributor

This is still a problem on master. Moving to 1.4.x milestone.

@asoules
Copy link

asoules commented Nov 19, 2015

👍 same issue here.

Narretz added a commit to Narretz/angular.js that referenced this issue Jan 28, 2016
- how to enable / disable animations

Closes angular#8812

- how to handle conflicts with existing animations

Closes angular#8033
Closes angular#11820

- what happens on boostrap / how to enable animations on bootstrap
Narretz added a commit to Narretz/angular.js that referenced this issue Jan 28, 2016
- how to enable / disable animations

Closes angular#8812

- how to handle conflicts with existing animations

Closes angular#8033
Closes angular#11820

- what happens on boostrap / how to enable animations on bootstrap
@Narretz Narretz closed this as completed in 4fed66d Feb 8, 2016
@Narretz
Copy link
Contributor Author

Narretz commented Feb 8, 2016

I believe this is not something that ngAnimate can be expected to solve. the bootstrap modal (at least in this version) doesn't use ngAnimate to trigger then moving / fading in of the modal, so ngAnimate has no chance to detect that there's an animation going on. If ngAnimate knew that there was an animation, it would not anmate stuff in the modal. I think in recent versions, the modal actually uses $animate, so this issue should be moot. Otherwise, the modal service could disable animations on the modal elements with $animate.enabled(el, false) until the opening animation has finished.

Narretz added a commit that referenced this issue Feb 8, 2016
- how to enable / disable animations

Closes #8812

- how to handle conflicts with existing animations

Closes #8033
Closes #11820

- what happens on boostrap / how to enable animations on bootstrap
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants