File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -460,7 +460,7 @@ jQuery.event = {
460460 } ,
461461
462462 // Includes some event props shared by KeyEvent and MouseEvent
463- props : ( "altKey bubbles cancelable ctrlKey currentTarget eventPhase " +
463+ props : ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " +
464464 "metaKey relatedTarget shiftKey target timeStamp view which" ) . split ( " " ) ,
465465
466466 fixHooks : { } ,
Original file line number Diff line number Diff line change @@ -2381,6 +2381,25 @@ test("hover event no longer special since 1.9", function() {
23812381 . off ( "hover" ) ;
23822382} ) ;
23832383
2384+ test ( "event object properties on natively-triggered event" , function ( ) {
2385+ expect ( 3 ) ;
2386+
2387+ var link = document . createElement ( "a" ) ,
2388+ $link = jQuery ( link ) ,
2389+ evt = document . createEvent ( "MouseEvents" ) ;
2390+
2391+ // IE9+ requires element to be in the body before it will dispatch
2392+ $link . appendTo ( "body" ) . on ( "click" , function ( e ) {
2393+ // Not trying to assert specific values here, just ensure the property exists
2394+ equal ( "detail" in e , true , "has .detail" ) ;
2395+ equal ( "cancelable" in e , true , "has .cancelable" ) ;
2396+ equal ( "bubbles" in e , true , "has .bubbles" ) ;
2397+ } ) ;
2398+ evt . initEvent ( "click" , true , true ) ;
2399+ link . dispatchEvent ( evt ) ;
2400+ $link . off ( "click" ) . remove ( ) ;
2401+ } ) ;
2402+
23842403test ( "fixHooks extensions" , function ( ) {
23852404 expect ( 2 ) ;
23862405
You can’t perform that action at this time.
0 commit comments