Skip to content

Draggable: Skip window bubbling test in IE 8 #1627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions tests/unit/draggable/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,21 +345,26 @@ test( "ui-draggable-handle managed correctly in nested draggables", function( as
assert.hasClasses( child, "ui-draggable-handle", "child retains class name on destroy" );
} );

test( "does not stop propagation to window", function( assert ) {
expect( 1 );
var element = $( "#draggable1" ).draggable();
// Support: IE 8 only
// IE 8 implements DOM Level 2 Events which only has events bubble up to the document.
// We skip this test since it would be impossible for it to pass in such an environment.
if ( document.documentMode !== 8 ) {
test( "does not stop propagation to window", function( assert ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use QUnit.skip here, something like:

QUnit[ document.documentMode === 8 ? "skip" : "test" ]( "does not stop propagation to window", function( assert ) {

Otherwise fine to land as-is.

expect( 1 );
var element = $( "#draggable1" ).draggable();

var handler = function() {
assert.ok( true, "mouseup propagates to window" );
};
$( window ).on( "mouseup", handler );

var handler = function() {
assert.ok( true, "mouseup propagates to window" );
};
$( window ).on( "mouseup", handler );
element.simulate( "drag", {
dx: 10,
dy: 10
} );

element.simulate( "drag", {
dx: 10,
dy: 10
$( window ).off( "mouseup", handler );
} );

$( window ).off( "mouseup", handler );
} );
}

} );