Opened 13 days ago

Last modified 12 days ago

#15123 pending bug

switchClass method removes the class if the toAddClass equals to toRemoveClass

Reported by: diegoperl Owned by: diegoperl
Priority: minor Milestone: none
Component: ui.effects.core Version: 1.12.1
Keywords: Cc:
Blocked by: Blocking:


In the bellow block, an element has class 'class1' if I call switchClass on that element and both "classtoRemove" and "classToAdd" are the same then the class is removed. probably because jquery first add the class and then removes it. I would expect jquery first to remove the classes and then to add so it won't remove totally the class if both arguments are the same

<div id='myEl' class='class1'></div>

$('#myEl').switchClass('class1', 'class1');

Change History (1)

comment:1 Changed 12 days ago by scottgonzalez

  • Component changed from ui.core to ui.effects.core
  • Owner set to diegoperl
  • Status changed from new to pending

Please explain why such a call should be considered valid input.

Note: See TracTickets for help on using tickets.