Skip to content

Conversation

kevin-brown
Copy link
Member

@kevin-brown kevin-brown commented Apr 19, 2020

This officially drops support for Internet Explorer 10 and below.

This pull request includes a

  • Bug fix
  • New feature
  • Translation
  • Miscellaneous

The following changes were made

  • Replace $.trim with String.prototype.trim
  • Replace $.isArray with Array.isArray
  • Replace $.fn.is(tagName) with Element.prototype.tagName
  • Replace $.inArray with Array.prototype.indexOf
  • Replace $.fn.addClass with classList.add
  • Replace $.fn.hasClass with classList.contains
  • Replace $.fn.removeClass with classList.remove
  • Remove non-MutationObserver change handling
  • Replace $.map with Array.prototype.map

If this is related to an existing ticket, include a link to it as well.

Fixes #4496

This officially drops support for Internet Explorer 8, since this
method is not provided by that browser. This is one more step closer
to removing the dependency on jQuery itself.
Now that we no longer support IE8, we can rely on this method
actually existing now.
This has long been unsupported, and now that we don't care about
IE8 with quirks mode, we can go back to expecting that `getAttribute`
actually returns the string like it is supposed to.
This also simplifies the logic used to use more modern array methods
to calculate the list of classes which need to be copied over to
the destination object.
This replaces calls to the jQuery `getClass`, `hasClass`, and
`removeClass` methods with the corresponding calls to `classList`
methods on the elements that are referenced. There is one exception
to this, specifically where results remove a class from any elements
which may contain it, since that cannot be easily translated to use
the `classList` syntax.
This removes the legacy tracking for `onpropertychange`, which was
used by IE 8, to synchronize attribute changes from the `<select>`
element back to Select2.

This removes the legacy tracking of `DOMNodeInserted`,
`DOMNodeRemoved`, and `DOMAttrModified` which was used by IE 9 and
IE 10 for tracking when `<option>` elements were added and removed,
as well as when attributes on the `<select>` element were
synchronized.

Now only the `MutationObserver` is in use for synchronizing changes
to the `<select>` as well as changes to the `<option>` elements that
it contains.
@kevin-brown kevin-brown marked this pull request as ready for review April 19, 2020 22:56
@kevin-brown kevin-brown merged commit f7cbd2c into develop Apr 19, 2020
@kevin-brown kevin-brown deleted the GH-4496 branch April 19, 2020 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove support for legacy IE
1 participant