Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switchClass() removes class if removeClass and addClass params are the same #2158

Open
gtasker10 opened this issue Mar 30, 2023 · 1 comment

Comments

@gtasker10
Copy link

I am using jQuery 3.6.0. Seems to be an undocumented "feature" with switchClass(). If I specify the same class to remove and then add, I get no class. In the following example, I would expect to see class="big":

   <input type="text" id="myInput" class="big"></input>
   <script>
      $(document).ready(function () {
         $("#myInput").switchClass("big", "big");
      });
   </script>

The above generates:

<input type="text" id="myInput" class="">

@mgol
Copy link
Member

mgol commented Apr 3, 2023

Thanks for the report. Does the issue you describe exist when jQuery UI 1.12.1 is used or only with jQuery UI 1.13.0 or newer?

@mgol mgol added the Needs info label Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants