Ticket #8113 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

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

comment:1 Changed 3 years ago by scott.gonzalez

  • Owner set to quasipickle
  • Status changed from new to pending

The linked fiddle doesn't exist.

comment:2 Changed 3 years ago by scott.gonzalez

  • Status changed from pending to open

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

comment:3 follow-up: ↓ 4 Changed 3 years ago by scott.gonzalez

  • Status changed from open to closed
  • Resolution set to fixed

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

comment:4 in reply to: ↑ 3 Changed 3 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 follow-up: ↓ 6 Changed 3 years ago by 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.

comment:6 in reply to: ↑ 5 Changed 3 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 3 years ago by scott.gonzalez

#8222 is a duplicate of this ticket.

comment:8 Changed 3 years ago by Corey Frang

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

Changeset: e220cf2a7dc709fdbbdfeacbb29378e005a0afd8

comment:9 Changed 3 years ago by gnarf

  • Milestone changed from 1.9 to 1.8.19

Should be fixed in next 1.8 release (1.8.19)

comment:10 Changed 3 years ago by scott.gonzalez

#7952 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.