aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-05-29 19:21:31 -0400
committerScott González <scott.gonzalez@gmail.com>2011-05-29 19:21:31 -0400
commit133fba2ad9b588233f7c7303619ac42351f08926 (patch)
tree9e409d95e73abebdbe4a276697ecc61b09fcd287 /tests
parentade1fe18875dfec29a70072360841c5466663291 (diff)
downloadjquery-ui-133fba2ad9b588233f7c7303619ac42351f08926.tar.gz
jquery-ui-133fba2ad9b588233f7c7303619ac42351f08926.zip
Tooltip: Don't close tooltips on mouseleave if the element is still focused.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/tooltip/tooltip_events.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/unit/tooltip/tooltip_events.js b/tests/unit/tooltip/tooltip_events.js
index 515760b28..61026882e 100644
--- a/tests/unit/tooltip/tooltip_events.js
+++ b/tests/unit/tooltip/tooltip_events.js
@@ -47,4 +47,30 @@ test( "focus events", function() {
element.trigger( "blur" );
});
+test( "mixed events", function() {
+ expect( 2 );
+ var element = $( "#tooltipped1" ).tooltip();
+
+ element.one( "tooltipopen", function( event ) {
+ same( event.originalEvent.type, "focusin" );
+ });
+ element[0].focus();
+
+ element.one( "tooltipopen", function() {
+ ok( false, "open triggered while already open" );
+ });
+ element.trigger( "mouseover" );
+
+ element.bind( "tooltipclose", function( event ) {
+ ok( false, "close triggered while still focused" );
+ });
+ element.trigger( "mouseleave" );
+ element.unbind( "tooltipclose" );
+
+ element.one( "tooltipclose", function( event ) {
+ same( event.originalEvent.type, "blur" );
+ });
+ element[0].blur();
+});
+
}( jQuery ) );