Opened 9 years ago

Closed 8 years ago

Last modified 7 years ago

#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)

11971.patch (2.7 KB) - added by Katie Vance 8 years ago.
Patch to shrink the around node when it is not completely visible
11971.2.patch (9.3 KB) - added by Katie Vance 8 years ago.
Update previous patch and include test cases
11971.3.patch (10.7 KB) - added by Katie Vance 8 years ago.

Download all attachments as: .zip

Change History (15)

Changed 8 years ago by Katie Vance

Attachment: 11971.patch added

Patch to shrink the around node when it is not completely visible

comment:1 Changed 8 years ago by Katie Vance

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 8 years ago by bill

Milestone: tbd1.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:3 Changed 8 years ago by bill

PS: not a robot test, just a plain automated test.

comment:4 Changed 8 years ago by bill

Milestone: 1.7future
Owner: changed from bill to Katie Vance

Marking for future until Katie is back.

Changed 8 years ago by Katie Vance

Attachment: 11971.2.patch added

Update previous patch and include test cases

comment:5 Changed 8 years ago by Katie Vance

Patch has been refreshed

comment:6 Changed 8 years ago by bill

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 8 years ago by Katie Vance

Attachment: 11971.3.patch added

comment:7 Changed 8 years ago by Katie Vance

Removed dependency on dojo and also moved the code to place.js.

comment:8 Changed 8 years ago by bill

Resolution: fixed
Status: newclosed

In [26505]:

Adjust popup position if around node is partially cut off by surrounding nodes with overflow:hidden/scroll. Patch from Katie Vance (IBM, CCLA), thanks! Fixes #11971 !strict.

comment:9 Changed 8 years ago by bill

Milestone: future1.7

comment:10 Changed 8 years ago by bill

In [27039]:

fix spelling, refs #11971

comment:11 Changed 7 years ago by bill

In [29044]:

Fix regression in dropdown placement when aroundNode or one of it's ancestors is position:absolute, and it's being displayed outside of an ancestor node with overflow:hidden/auto/scroll. Fixes #15555, refs #11971 on trunk, !strict.

comment:12 Changed 7 years ago by bill

In [29045]:

Fix regression in dropdown placement when aroundNode or one of it's ancestors is position:absolute, and it's being displayed outside of an ancestor node with overflow:hidden/auto/scroll. Fixes #15555, refs #11971 on 1.7/ branch, !strict.

Note: See TracTickets for help on using tickets.