mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Try to fix focus test again
This commit is contained in:
parent
b31bd4c05d
commit
c809736db2
@ -2640,8 +2640,6 @@ test( "make sure events cloned correctly", 18, function() {
|
||||
clone.find("#check1").trigger("change"); // 0 events should fire
|
||||
});
|
||||
|
||||
// This test fails in some browsers if document does not have focus
|
||||
if ( !document.hasFocus || document.hasFocus && document.hasFocus() ) {
|
||||
test( "Check order of focusin/focusout events", 2, function() {
|
||||
var focus, blur,
|
||||
input = jQuery( "#name" );
|
||||
@ -2659,16 +2657,23 @@ if ( !document.hasFocus || document.hasFocus && document.hasFocus() ) {
|
||||
ok( !blur, "Focusout event should fire before blur does" );
|
||||
});
|
||||
|
||||
// This test fails in some browsers if document does not have focus
|
||||
if ( !document.hasFocus || document.hasFocus() ) {
|
||||
|
||||
// gain focus
|
||||
input.trigger( "focus" );
|
||||
|
||||
} else {
|
||||
expect( 1 );
|
||||
ok( true, "Document does not have focus - skipping" );
|
||||
}
|
||||
|
||||
// then lose it
|
||||
jQuery( "#search" ).trigger( "focus" );
|
||||
|
||||
// cleanup
|
||||
input.off();
|
||||
});
|
||||
}
|
||||
|
||||
test( "String.prototype.namespace does not cause trigger() to throw (#13360)", function() {
|
||||
expect( 1 );
|
||||
|
Loading…
Reference in New Issue
Block a user