bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Carousel does not work with Angular 1.4.0

Open smajl opened this issue 11 years ago • 20 comments

EDIT: I have just noticed, that you only support Angular 1.3.x. You can close this if desired.

Carousel does only one cycle, then stops. Sliding manually does not work. There is no such problem with Angular 1.3.16 - just change version number in Plunker and see for yourself.

Angular: 1.4.0 UI-Bootstrap: 0.13.0 Plunker: http://plnkr.co/edit/IlauLdEJoar76cD14BLc?p=preview

smajl avatar Jun 12 '15 15:06 smajl

If I had to guess, this is due to the breaking changes with ngAnimate in 1.4.

Soon the team is going to have a discussion on what needs to be done to get 0.13.1 out the door, then we will be looking into Bootstrap 3.3 support & likely Angular 1.4

wesleycho avatar Jun 12 '15 22:06 wesleycho

Is there any timeline for support Angular 1.4?

dkegle avatar Jun 19 '15 09:06 dkegle

I'm looking forward to supporting 1.4 . Unfortunately, the current carousel animations are a bunch of hacks (my fault) made to run on $animate before $animateCss was introduced. It currently relies on JS and CSS animations running in parallel. However, this is no longer allowed as of 1.4 .

chrisirhc avatar Jul 06 '15 07:07 chrisirhc

A bit of experimental stuff on 13.0 because I need it for a project. Perhaps a nice PR

What do you think? Also, how would you go about supporting @chrisirhc on > 1.3; using angular.version to inject differently?

Cheers!

https://github.com/mchlbrnd/bootstrap/tree/carousel-animatecss.

mchlbrnd avatar Jul 10 '15 10:07 mchlbrnd

$animateCss does not exist in 1.3, and so we cannot move to changeover to use it until we start work on a release to support 1.4 unless we consume $injector directly and execute code depending on the angular version loaded. We are currently working towards a 0.13.1 release of bugfixes, and will work on 1.4 support after then.

Using $injector may not be a bad idea necessarily - any solution that would currently be accepted in master would have to support angular 1.3 though.

wesleycho avatar Jul 10 '15 14:07 wesleycho

In order to support that though, we would need some build tooling adjustment to run the tests for angular 1.3 and 1.4

wesleycho avatar Jul 10 '15 14:07 wesleycho

Indeed $injector + angular.version would work perfectly for now.

I haven't checked all specs for mocked $animate other than carousel, but the latter does not feature it. On the road now..

mchlbrnd avatar Jul 10 '15 15:07 mchlbrnd

Check https://github.com/mchlbrnd/bootstrap/commit/0490507f4652160961bb1ab58998f1cc4fc5a88e!

Let me know if you're interested in a PR and in which version you want this to land. Currently build against 0.13.0.

Cheers!

mchlbrnd avatar Jul 11 '15 13:07 mchlbrnd

Any PR should be based off of master and be against master.

That commit looks like a promising start, but it would need to be cleaned up.

Perhaps when the test(s) are made/tweaked, tests could be hidden behind an if else conditional, or we may want build tooling to be tweaked. Do you have any thoughts @chrisirhc about how we should handle supporting a temporary dual support of Angular 1.3 and 1.4 simultaneously until we move to Angular 1.4 fully?

wesleycho avatar Jul 11 '15 15:07 wesleycho

@mchlbrnd 's solution looks good (sniffing the version). That way, the tests don't need to be changed as of yet.

@mchlbrnd could you submit a PR? We can start reviewing and get this into the next release.

chrisirhc avatar Jul 12 '15 16:07 chrisirhc

Imho this is also broken with 1.3.13. See this plunkr http://plnkr.co/edit/KixcEb1uDNNgdXEzTDCe?p=preview

gytisgreitai avatar Jul 13 '15 12:07 gytisgreitai

It is not broken with 1.3.13: http://plnkr.co/edit/MdZsM16V3hTohh8Rhdv7?p=preview

wesleycho avatar Jul 13 '15 14:07 wesleycho

Ok, so 0.13.0 requires ng-animate, while 0.12.0 does not: http://plnkr.co/edit/6i8M63gKMuAWfUYGtbYa?p=preview Also note that my first plunker is taken from https://angular-ui.github.io/bootstrap/ by clicking "Edit in plunker"

gytisgreitai avatar Jul 14 '15 06:07 gytisgreitai

0.12.0 (& 0.12.1) forces it as a requirement - 0.13.0 makes it optional.

wesleycho avatar Jul 14 '15 06:07 wesleycho

I'm a bit confused here. As I understand it, the actual issue is that $animate does not emit events on the jqlite element anymore; therefore when currentTransition is supposed to be set to null, nothing happens and it locks. @mchlbrnd 's solution also solves this in addition to using $animateCss.

However, the use of $animate.addClass is still completely valid in 1.4. Are there other issues that using $animateCss solves? Perhaps it can be said that $animateCss produces cleaner code, but since support for 1.3 and 1.4 is desired, why would you put this extra code in if the original works in both versions?

dairyisscary avatar Jul 15 '15 17:07 dairyisscary

In 1.4, there is a breaking change where animation by JS & CSS mixed together is forbidden in ngAnimate - this requires use of $animateCss.

wesleycho avatar Jul 17 '15 15:07 wesleycho

+1

rgolea avatar Jul 29 '15 17:07 rgolea

Please do not +1 issues, it only adds noise.

wesleycho avatar Jul 29 '15 17:07 wesleycho

I'm not sure this is fixed — am using Angular 1.4.3 and UI-Bootstrap 0.13.2, and having ng-animate enabled still definitely breaks the carousel...

aendra-rininsland avatar Aug 05 '15 11:08 aendra-rininsland

It is fixed on master

wesleycho avatar Aug 05 '15 12:08 wesleycho