#11971 closed defect (fixed)
Tooltip positions to wrong location if aroundNode is not fully visible
Reported by: | Katie Vance | Owned by: | Katie Vance |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | Dijit | Version: | 1.4.3 |
Keywords: | tooltip, grid | Cc: | |
Blocked By: | Blocking: |
Description
If a node to place a tooltip around is not fully visible, then the tooltip will position itself incorrectly. For example, a parent node may prevent the around node from completely displaying via overflow set to hidden.
This can be easily reproduced with !test_grid_tooltip_menu.html. Any cells that are not fully visible will have a large whitespace between the visible end of the cell and the tooltip.
Attachments (3)
Change History (15)
Changed 12 years ago by
Attachment: | 11971.patch added |
---|
comment:1 Changed 12 years ago by
Bill,
To resolve this issue, I check all parent nodes of the node we are placing the tooltip around. If any of the parents do not fully contain the around node and the parent node has overlow set to hidden, then we must reduce the parameters we pass to match the parent nodes smaller containing size.
I attached the patch to resolve this issue, however, I'm not comfortable having it go into 1.6 this late. The reason being because it modifies place.js and requires the use of dojo.getComputedStyle to determine if overflow is hidden. I've narrowed down the use of that method as much as possible minimize any performance issue. Although it currently passes all dijit tests, I think there is a good chance there are lots of other scenarios that could be covered. We should test widgets (that make use of place) embedded within multiple widgets and layouts. That's why I think dropping it in the beginning of the next release would give us better test coverage.
If you know of a better way or place to put this fix, let me know and I'll work on modifying the patch.
comment:2 Changed 12 years ago by
Milestone: | tbd → 1.7 |
---|
OK, thanks for the patch, and I'm fine with moving it to 1.7.
Your patch is along the same lines I was thinking about although you could reduce the code a lot by using Math.min() rather than if() statements. And also, it should handle overflow:scroll in ancestor nodes; it's the same as overflow:hidden (note though ideally we want to measure the position/area of the node not including the scrollbars).
Also of course, we need new test(s) for this.
comment:4 Changed 11 years ago by
Milestone: | 1.7 → future |
---|---|
Owner: | changed from bill to Katie Vance |
Marking for future until Katie is back.
Changed 11 years ago by
Attachment: | 11971.2.patch added |
---|
Update previous patch and include test cases
comment:6 Changed 11 years ago by
OK, thanks, a few more things:
- can't use "dojo" global variable anymore, starting with 1.7.
- seems like code should be in place.js rather than Tooltip.js?
Changed 11 years ago by
Attachment: | 11971.3.patch added |
---|
comment:9 Changed 11 years ago by
Milestone: | future → 1.7 |
---|
Patch to shrink the around node when it is not completely visible