jQuery 3.4.1: triggering focus events in IE and finding root elements in iOS 10


Hello again! jQuery 3.4.0 was released just three weeks ago, but we’ve had a few issues reported that warranted a patch release. Thank you to everyone that reported issues and helped us get these fixed quickly. Here are the changes:

Triggering focus or blur more than once in IE

jQuery 3.4.0 came with some changes to the way the event handler triggered native events such focus and blur. These changes caused a regression that sometimes resulted in an enigmatic error being thrown in the form of "saved.shift is not a function". This is now fixed.

Example

// Error thrown in IE10-11
// after clicking #test-element twice
jQuery("#test-element").click(function() {
jQuery(this).trigger("blur");
});

Checking element attachment in iOS 10.0-10.2

When releasing 3.4.0, we ran our tests in several versions of iOS, including iOS 10.3 but not 10.0-10.2. Those versions do not support a native function we use to determine whether an element is attached to the DOM. Other versions of iOS were not affected. We added a guard to ensure that this method exists and fall back to other options if necessary.

Loading jQuery with AMD

A small module was added in jQuery 3.4.0 that used the global jQuery rather than the local jQuery loaded with AMD. This resulted in "jQuery is undefined" errors when loading with AMD, but this should now be fixed.

 

Upgrading

There should be no compatibility issues if upgrading from jQuery 3.0+. If you haven’t yet upgraded to jQuery 3+, please have a look at the 3.0 Upgrade Guide. The jQuery Migrate 3.0 plugin will help you to identify compatibility issues in your code.

Please try out this new release and let us know about any issues you experienced.

Download

You can get the files from the jQuery CDN, or link to them directly:

https://code.jquery.com/jquery-3.4.1.js

https://code.jquery.com/jquery-3.4.1.min.js

You can also get this release from npm:

npm install jquery@3.4.1

Slim build

Sometimes you don’t need ajax, or you prefer to use one of the many standalone libraries that focus on ajax requests. And often it is simpler to use a combination of CSS and class manipulation for web animations. Along with the regular version of jQuery that includes the ajax and effects modules, we’ve released a “slim” version that excludes these modules. The size of jQuery is very rarely a load performance concern these days, but the slim build is about 6k gzipped bytes smaller than the regular version. These files are also available in the npm package and on the CDN:

https://code.jquery.com/jquery-3.4.1.slim.js

https://code.jquery.com/jquery-3.4.1.slim.min.js

These updates are already available as the current versions on npm and Bower. Information on all the ways to get jQuery is available at https://jquery.com/download/. Public CDNs receive their copies today, please give them a few days to post the files. If you’re anxious to get a quick start, use the files on our CDN until they have a chance to update.

Thanks

Thank you to all of you who participated in this release by submitting patches, reporting bugs, or testing, including Richard Gibson, Michal Golebiowski-Owczarek, and the whole jQuery team.

Changelog

GitHub changelog: Issues fixed in 3.4.1 | All changes

Build

  • Fix unresolved jQuery reference in finalPropName (#4358, 0d4af529)

Core

Event

  • Prevent leverageNative from registering duplicate dummy handlers (6c1e7dbf)
  • Fix handling of multiple async focus events (#4350, 24d71ac7)