File tree Expand file tree Collapse file tree 3 files changed +33
-7
lines changed Expand file tree Collapse file tree 3 files changed +33
-7
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ <h2 id="qunit-userAgent"></h2>
4646< span  id ="contains-tooltipped " title ="parent "> < span  id ="contained-tooltipped " title ="child "> baz</ span > </ span > 
4747</ div > 
4848
49+ < form  id ="tooltip-form "> 
50+ < input  name ="title " title ="attroperties "> 
51+ </ form > 
52+ 
4953</ div > 
5054</ body > 
5155</ html > 
Original file line number Diff line number Diff line change @@ -73,4 +73,25 @@ test( "nested tooltips", function() {
7373equal (  $ (  ".ui-tooltip"  ) . text ( ) ,  "child"  ) ; 
7474} ) ; 
7575
76+ // #8742 
77+ test (  "form containing an input with name title" ,  function ( )  { 
78+ expect (  4  ) ; 
79+ 
80+ var  form  =  $ (  "#tooltip-form"  ) . tooltip ( { 
81+ show : null , 
82+ hide : null 
83+ } ) , 
84+ input  =  form . find (  "[name=title]"  ) ; 
85+ 
86+ equal (  $ (  ".ui-tooltip"  ) . length ,  0 ,  "no tooltips on init"  ) ; 
87+ 
88+ input . trigger (  "mouseover"  ) ; 
89+ equal (  $ (  ".ui-tooltip"  ) . length ,  1 ,  "tooltip for input"  ) ; 
90+ input . trigger (  "mouseleave"  ) ; 
91+ equal (  $ (  ".ui-tooltip"  ) . length ,  0 ,  "tooltip for input closed"  ) ; 
92+ 
93+ form . trigger (  "mouseover"  ) ; 
94+ equal (  $ (  ".ui-tooltip"  ) . length ,  0 ,  "no tooltip for form"  ) ; 
95+ } ) ; 
96+ 
7697} (  jQuery  )  ) ; 
Original file line number Diff line number Diff line change @@ -164,19 +164,20 @@ $.widget( "ui.tooltip", {
164164// kill parent tooltips, custom or native, for hover 
165165if  (  event  &&  event . type  ===  "mouseover"  )  { 
166166target . parents ( ) . each ( function ( )  { 
167- var  blurEvent ; 
168- if  (  $ (  this  ) . data (  "tooltip-open"  )  )  { 
167+ var  parent  =  $ (  this  ) , 
168+ blurEvent ; 
169+ if  (  parent . data (  "tooltip-open"  )  )  { 
169170blurEvent  =  $ . Event (  "blur"  ) ; 
170171blurEvent . target  =  blurEvent . currentTarget  =  this ; 
171172that . close (  blurEvent ,  true  ) ; 
172173} 
173- if  (  this . title  )  { 
174- $ (   this   ) . uniqueId ( ) ; 
174+ if  (  parent . attr (   " title"   )  )  { 
175+ parent . uniqueId ( ) ; 
175176that . parents [  this . id  ]  =  { 
176177element : this , 
177- title : this . title 
178+ title : parent . attr (   " title"   ) 
178179} ; 
179- this . title   =   "" ; 
180+ parent . attr (   " title" ,   ""   ) ; 
180181} 
181182} ) ; 
182183} 
@@ -334,7 +335,7 @@ $.widget( "ui.tooltip", {
334335
335336if  (  event  &&  event . type  ===  "mouseleave"  )  { 
336337$ . each (  this . parents ,  function (  id ,  parent  )  { 
337- parent . element . title   =   parent . title ; 
338+ $ (   parent . element   ) . attr (   " title" ,   parent . title   ) ; 
338339delete  that . parents [  id  ] ; 
339340} ) ; 
340341} 
                         You can’t perform that action at this time. 
           
                  
0 commit comments