From d074efe5289db4f5182a685046e9b9ad6186ac26 Mon Sep 17 00:00:00 2001 From: Scott González Date: Sun, 28 Oct 2012 20:28:55 -0400 Subject: Tooltip: Use attributes, not properties, when checking for parent tooltips. Fixes #8742 - Tooltip shows incorrect message in chrome if there is input with name='title' in a form. --- tests/unit/tooltip/tooltip.html | 4 ++++ tests/unit/tooltip/tooltip_core.js | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'tests/unit/tooltip') diff --git a/tests/unit/tooltip/tooltip.html b/tests/unit/tooltip/tooltip.html index ca5a1239a..ec616be13 100644 --- a/tests/unit/tooltip/tooltip.html +++ b/tests/unit/tooltip/tooltip.html @@ -46,6 +46,10 @@ baz +
+ +
+ diff --git a/tests/unit/tooltip/tooltip_core.js b/tests/unit/tooltip/tooltip_core.js index 6e9bee208..f0aed72aa 100644 --- a/tests/unit/tooltip/tooltip_core.js +++ b/tests/unit/tooltip/tooltip_core.js @@ -73,4 +73,25 @@ test( "nested tooltips", function() { equal( $( ".ui-tooltip" ).text(), "child" ); }); +// #8742 +test( "form containing an input with name title", function() { + expect( 4 ); + + var form = $( "#tooltip-form" ).tooltip({ + show: null, + hide: null + }), + input = form.find( "[name=title]" ); + + equal( $( ".ui-tooltip" ).length, 0, "no tooltips on init" ); + + input.trigger( "mouseover" ); + equal( $( ".ui-tooltip" ).length, 1, "tooltip for input" ); + input.trigger( "mouseleave" ); + equal( $( ".ui-tooltip" ).length, 0, "tooltip for input closed" ); + + form.trigger( "mouseover" ); + equal( $( ".ui-tooltip" ).length, 0, "no tooltip for form" ); +}); + }( jQuery ) ); -- cgit v1.2.3