aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tooltip
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-11-14 14:14:25 -0500
committerScott González <scott.gonzalez@gmail.com>2012-11-14 14:14:45 -0500
commit1b503a237e1dc47739a8a451debbc86e169851e3 (patch)
tree75dc0f90353937dc72cf3c26d00bc310bba5037e /tests/unit/tooltip
parenteca5abd873675f5cc7b96641c723b7e35a4260bc (diff)
downloadjquery-ui-1b503a237e1dc47739a8a451debbc86e169851e3.tar.gz
jquery-ui-1b503a237e1dc47739a8a451debbc86e169851e3.zip
Tooltip: Handle synthetic focusin events. Fixes #8740 - Tooltip: Does not hide consistently with dynamically loaded content.
Diffstat (limited to 'tests/unit/tooltip')
-rw-r--r--tests/unit/tooltip/tooltip_core.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/unit/tooltip/tooltip_core.js b/tests/unit/tooltip/tooltip_core.js
index 69936dba2..c3568bffc 100644
--- a/tests/unit/tooltip/tooltip_core.js
+++ b/tests/unit/tooltip/tooltip_core.js
@@ -107,4 +107,31 @@ test( "tooltip on .ui-state-disabled element", function() {
equal( $( ".ui-tooltip" ).length, 0 );
});
+// http://bugs.jqueryui.com/ticket/8740
+asyncTest( "programmatic focus with async content", function() {
+ expect( 2 );
+ var element = $( "#tooltipped1" ).tooltip({
+ content: function( response ) {
+ setTimeout(function() {
+ response( "test" );
+ });
+ }
+ });
+
+ element.bind( "tooltipopen", function( event ) {
+ deepEqual( event.originalEvent.type, "focusin" );
+
+ element.bind( "tooltipclose", function( event ) {
+ deepEqual( event.originalEvent.type, "focusout" );
+ start();
+ });
+
+ setTimeout(function() {
+ element.blur();
+ });
+ });
+
+ element.focus();
+});
+
}( jQuery ) );