Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#8113 closed bug (fixed)

addClass not animating

Reported by: quasipickle Owned by: quasipickle
Priority: minor Milestone: 1.8.19
Component: ui.effects.core Version: 1.8.17
Keywords: Cc:
Blocked by: Blocking:

Description

Calling addClass() with a second parameter does not animate the style change, unless the element has a "class" attribute.

Example: http://jsfiddle.net/Z6mJU/108/ (Note: jsFiddle only has v1.8.16, but I'm experiencing the problem with 1.8.17, it's just not demonstrable via jsFiddle)

Affected jQueryUI versions: 1.8.17 (running the above Fiddle with v1.8.9 and v1.8.7 do work, so I'm guessing this is a regression?

Browsers tested: Firefox 9.0.1, Chrome 17

OS tested: OS X

Expected results: all animate-able properties of the class to be added, get animated in over the provided duration.

Encountered results: Without a "class" attribute, the class gets added immediately - just as it would with the default jQuery addClass() function.

Change History (10)

comment:1 Changed 6 years ago by Scott González

Owner: set to quasipickle
Status: newpending

The linked fiddle doesn't exist.

comment:2 Changed 6 years ago by Scott González

Status: pendingopen

Confirmed. The test case is as easy as it sounds.

comment:3 Changed 6 years ago by Scott González

Resolution: fixed
Status: openclosed

This works fine in master: http://jsfiddle.net/Z6mJU/110/

comment:4 in reply to:  3 Changed 6 years ago by jngeist

Replying to scott.gonzalez:

This works fine in master: http://jsfiddle.net/Z6mJU/110/

Unfortunately, that's not accurate. In that fiddle, JQueryUI isn't loaded. Loading JQueryUI reproduces the problem.

This modification of that fiddle better represents the problem, and also includes a workaround which itself demonstrates the problem: http://jsfiddle.net/Z6mJU/144/

With JQueryUI enabled, the first div--which has no class attribute in the HTML--doesn't animate, but jumps directly to the applied class.

The second div--which has a class attribute--does animate as intended.

By adding a dummy class to the third (and thus establishing a class attribute) before adding the animated addClass call, the animation applies as intended.

comment:5 Changed 6 years ago by Scott González

Actually, jQuery UI is loaded in my fiddle. I have no idea why you think it's not. What do you think is causing the animation if jQuery UI is not loaded? All you've done in your fiddle is go back to using jQuery UI 1.8.16, which I've confirmed is broken.

comment:6 in reply to:  5 Changed 6 years ago by jngeist

Replying to scott.gonzalez:

Actually, jQuery UI is loaded in my fiddle. I have no idea why you think it's not. What do you think is causing the animation if jQuery UI is not loaded? All you've done in your fiddle is go back to using jQuery UI 1.8.16, which I've confirmed is broken.

I was just coming back to say this, because I am obviously an idiot. Sorry about this.

comment:7 Changed 6 years ago by Scott González

#8222 is a duplicate of this ticket.

comment:8 Changed 6 years ago by Corey Frang

Effects: Backporting e8ba367 to 1-8-stable - Fixes #8113 - addClass not animating

Changeset: e220cf2a7dc709fdbbdfeacbb29378e005a0afd8

comment:9 Changed 6 years ago by Corey Frang

Milestone: 1.91.8.19

Should be fixed in next 1.8 release (1.8.19)

comment:10 Changed 5 years ago by Scott González

#7952 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.