Bug Tracker

Opened 7 years ago

Closed 7 years ago

#11883 closed bug (invalid)

Possible bug in toggleClass

Reported by: troels@… Owned by: troels@…
Priority: low Milestone: None
Component: css Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:

Description

Not sure if it's a bug or not, but it seems there's an issue with class order in the toggleClass function.

The function only works for me when the toggled class is loaded after the original class in the css.

Is that on purpose?

I've tried most recent version of jQuery.

P.S. I'm otherwise more than satisfied with jQuery. Great job guys!!

Change History (3)

comment:1 Changed 7 years ago by sindresorhus

Owner: set to troels@…
Status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

comment:2 Changed 7 years ago by troels@…

Status: pendingnew

Take a look at this example:

http://jsfiddle.net/h7a2m/4/

comment:3 Changed 7 years ago by sindresorhus

Component: unfiledcss
Priority: undecidedlow
Resolution: invalid
Status: newclosed

If you inspect your HTML you can clearly see that the correct classes are applied. This is a problem with CSS specificity and not jQuery.

Note: See TracTickets for help on using tickets.