@@ -409,7 +409,12 @@ $.extend($.validator, {
409
409
focusInvalid : function ( ) {
410
410
if ( this . settings . focusInvalid ) {
411
411
try {
412
- $ ( this . findLastActive ( ) || this . errorList . length && this . errorList [ 0 ] . element || [ ] ) . filter ( ":visible" ) . focus ( ) ;
412
+ $ ( this . findLastActive ( ) || this . errorList . length && this . errorList [ 0 ] . element || [ ] )
413
+ . filter ( ":visible" )
414
+ . focus ( )
415
+ // manually trigger validatefocusin event in IE, where focusin isn't a special event triggered by a triggered focus event
416
+ // without it, focusin handler isn't called, findLastActive won't have anything to find
417
+ . trigger ( "validatefocusin" ) ;
413
418
} catch ( e ) {
414
419
// ignore IE throwing errors when focusing hidden elements
415
420
}
@@ -1101,8 +1106,6 @@ $.format = $.validator.format;
1101
1106
1102
1107
// provides delegate(type: String, delegate: Selector, handler: Callback) plugin for easier event delegation
1103
1108
// handler is only called when $(event.target).is(delegate), in the scope of the jquery-object for event.target
1104
-
1105
- // provides triggerEvent(type: String, target: Element) to trigger delegated events
1106
1109
; ( function ( $ ) {
1107
1110
$ . each ( {
1108
1111
focus : 'validatefocusin' ,
@@ -1111,19 +1114,23 @@ $.format = $.validator.format;
1111
1114
$ . event . special [ fix ] = {
1112
1115
setup :function ( ) {
1113
1116
if ( $ . browser . msie ) return false ;
1114
- this . addEventListener ( original , $ . event . special [ fix ] . handler , true ) ;
1117
+ this . addEventListener ( original , handler , true ) ;
1115
1118
} ,
1116
1119
teardown :function ( ) {
1117
1120
if ( $ . browser . msie ) return false ;
1118
- this . removeEventListener ( original ,
1119
- $ . event . special [ fix ] . handler , true ) ;
1121
+ this . removeEventListener ( original , handler , true ) ;
1120
1122
} ,
1121
1123
handler : function ( e ) {
1122
1124
arguments [ 0 ] = $ . event . fix ( e ) ;
1123
1125
arguments [ 0 ] . type = fix ;
1124
1126
return $ . event . handle . apply ( this , arguments ) ;
1125
1127
}
1126
1128
} ;
1129
+ function handler ( e ) {
1130
+ e = $ . event . fix ( e ) ;
1131
+ e . type = fix ;
1132
+ return $ . event . handle . call ( this , e ) ;
1133
+ }
1127
1134
} ) ;
1128
1135
$ . extend ( $ . fn , {
1129
1136
validateDelegate : function ( delegate , type , handler ) {
0 commit comments