Skip to content

Commit

Permalink
Event: fixing pageX/pageY mouse information in drag events
Browse files Browse the repository at this point in the history
  • Loading branch information
araghava committed Dec 27, 2014
1 parent 76df9e4 commit 1f62510
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ define([

var
rkeyEvent = /^key/,
rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
rmouseEvent = /^(?:mouse|pointer|contextmenu|drag)|click/,
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
rtypenamespace = /^([^.]*)(?:\.(.+)|)/;

Expand Down
14 changes: 14 additions & 0 deletions test/unit/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -2444,6 +2444,20 @@ test("fixHooks extensions", function() {
jQuery.event.fixHooks.click = saved;
});

test( "drag events copy over mouse related event properties (#1925)", function() {
expect( 2 );

var $fixture = jQuery( "<div id='drag-fixture'></div>" ).appendTo( "body" );

$fixture.bind( "dragmove", function( evt ) {
ok( "pageX" in evt, "checking for pageX property" );
ok( "pageY" in evt, "checking for pageY property" );
});

fireNative( $fixture[ 0 ], "dragmove" );
$fixture.unbind( "dragmove" ).remove();
});

test( "focusin using non-element targets", function() {
expect( 2 );

Expand Down

0 comments on commit 1f62510

Please sign in to comment.