Opened 11 years ago
Closed 9 years ago
#11504 closed defect (fixed)
dijit.Tooltip is positioned over hovered child element, not the connectId element
Reported by: | Thomas Bachem | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.8 |
Component: | Dijit | Version: | 1.5 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
We are using dijit.Tooltip on elements than contain child elements.
Example:
<div id="parent" title="My tooltip"> <div id="foo">Foo</div> <div id="bar">Bar</div> </div>
When hovering over the element, the tooltip is positioned over the element the mouse first entered (e.g. ID "foo"), not always the parent element (ID "parent") that dijit.Tooltip was applied to.
This can lead to confusion a) depending on the direction the element is entered by the cursor and the position of the child elements b) because sometimes a mouse enter event is triggered directly on a child element before it was triggered on the parent element if one is moving the cursor fast (at least in Firefox 3.6.7).
It would be nice to have an option to tell dijit.Tooltip if this behaviour is wanted or not.
Change History (4)
comment:1 Changed 10 years ago by
comment:2 Changed 9 years ago by
Looks like Tooltip._onHover() is referencing evt.target, which is wrong:
if(!this._showTimer){ var target = e.target; this._showTimer = setTimeout(lang.hitch(this, function(){this.open(target)}), this.showDelay); }
It should be using the node that was connected to. I guess that needs to be passed in to the function, as it doesn't seem available through the event object.
Just need to add an automated test along with the fix.
comment:3 Changed 9 years ago by
Milestone: | tbd → 1.8 |
---|---|
Owner: | set to bill |
Status: | new → assigned |
Summary: | dijit.Tooltip is positioned over hovered child element, not the parent element that defines the tooltip → dijit.Tooltip is positioned over hovered child element, not the connectId element |
Type: | enhancement → defect |
I'll check in a fix. I consider the current behavior a bug.
Can you attach an a test case using the Attach File button? Your code above isn't creating a dijit.Tooltip.