Opened 6 years ago

Closed 6 years ago

#15123 closed 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:

Description

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 (2)

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

Component: ui.coreui.effects.core
Owner: set to diegoperl
Status: newpending

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

comment:2 Changed 6 years ago by trac

Status: pendingclosed

This ticket was closed automatically by the system. It was previously set to a Pending status and hasn't been updated within 14 days.

Note: See TracTickets for help on using tickets.