From 3b2d1e7736be99671af70aa3b775d67b917517e5 Mon Sep 17 00:00:00 2001 From: Andrew Couch Date: Mon, 15 Oct 2012 16:15:36 -0400 Subject: Tooltip: handle removal of elements with delegated tooltips. Fixed #8646 - Delegated tooltips don't close when the tooltipped element is removed --- tests/unit/tooltip/tooltip.html | 1 + tests/unit/tooltip/tooltip_core.js | 13 +++++++++++++ 2 files changed, 14 insertions(+) (limited to 'tests/unit/tooltip') diff --git a/tests/unit/tooltip/tooltip.html b/tests/unit/tooltip/tooltip.html index f6e60b367..2c9667ff5 100644 --- a/tests/unit/tooltip/tooltip.html +++ b/tests/unit/tooltip/tooltip.html @@ -43,6 +43,7 @@ aria-describedby span + baz diff --git a/tests/unit/tooltip/tooltip_core.js b/tests/unit/tooltip/tooltip_core.js index 2b39253a2..06fb194cd 100644 --- a/tests/unit/tooltip/tooltip_core.js +++ b/tests/unit/tooltip/tooltip_core.js @@ -44,4 +44,17 @@ test( "accessibility", function() { equal( element.attr( "title" ), "...", "title restored when closed" ); }); +test( "delegated removal", function() { + expect( 2 ); + + var container = $( "#contains-tooltipped" ).tooltip(), + element = $( "#contained-tooltipped" ); + + element.trigger( "mouseover" ); + equal( $( ".ui-tooltip" ).length, 1 ); + + container.empty(); + equal( $( ".ui-tooltip" ).length, 0 ); +}); + }( jQuery ) ); -- cgit v1.2.3