classList.toggle ignores second parameter on IE11

Won’t fix Issue #11865865

Details

Author
Jesse L.
Created
May 2, 2017
Privacy
This issue is public.
Found in
  • Internet Explorer
Standard affected
DOM Standard

Found in build #
11
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Description

classList.toggle has a second parameter force. According to MDN:

If the second argument evaluates to true, add specified class value, and if it evaluates to false, remove it.

Setting the second attribute does not have any effect on IE11.

How to reproduce

  1. Create a div
  2. Try to unset a non-existing class with toggle: document.getElementById('mydiv').classList.toggle('someclassname', false)

Behaviour

The div has class someclassname

Expected behaviour

The div should not have class someclassname

Demo

You can see a live demo in:

http://html5doctor.com/demos/classlist/classlist.toggle-true.html

Affected browsers

Tested on the following IE versions:

  • IE 11.0.15063.0 on Windows 10
  • IE 11.63.10586.0 on Windows 10
  • IE 11.1066.14393.0 on Windows 10

Notes

This has previously been reported to:

https://connect.microsoft.com/IE/feedback/details/878564/element-classlist-toggle-does-not-support-second-parameter

The issue states it should be fixed, but further comments and testing indicates it is not fixed.

Attachments

0 attachments

    Comments and activity

    • Changed Steps to Reproduce

    • Microsoft Edge Team

      Changed Assigned To to “James M.”

      Changed Status to “Won’t fix”

    • Hello,

      Thank you for providing your feedback on IE11. We are not accepting feedback on Internet Explorer through this portal any longer (unless security related). However, we are pleased to report this feature is fixed in MS Edge and is available in our latest build.

      Best Wishes,
      The MS Edge Team

    You need to sign in to your Microsoft account to add a comment.

    Sign in