-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Description
Hello,
$(...).prop("tabIndex") behaves differently in JQuery 1.11.3 and 2.1.4 when Internet Explorer 11 is used.
This is true at least for images (dom nodes of type ) that doesn't have an attribute "tabindex" explicitly given.
Please see also the playground example here:
http://jsbin.com/herehipoke/1/edit?html,output
When changing the URL of the loaded jQuery version, you can see that the tabIndex is different ("0" vs. "-1").
This is because of changes in attributes/porp.js file...
The propHook for tabIndex is different:
The current code line (master and 2.1 stable) show the code of propHooks - tabIndex as follows:
get: function( elem ) {
return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
elem.tabIndex : -1;
}1.11.1 looks like that:
get: function( elem ) {
var tabindex = jQuery.find.attr( elem, "tabindex" );
return tabindex ?
parseInt( tabindex, 10 ) :
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : -1;
}I've seen that jQuery Compat 3.0 Alpha uses the 1.11 logic again. Maybe it would make sense to move that kind of logic also into jQuery 2/3 as Internet Explorers are still supprted (at least the newer ones starting from 9 upwards).
Best regards,
Alexander