diff options
author | Mika Murtojarvi <mika@vaadin.com> | 2014-11-05 16:47:07 +0200 |
---|---|---|
committer | Anna Koskinen <anna@vaadin.com> | 2014-11-06 16:01:54 +0200 |
commit | aacb2f8289bc2faaab1225bd8b0dacd873d7839a (patch) | |
tree | b57cfb299f0b0e384c49433ce9f067b5ac46ab7e /client | |
parent | f6b9f60a004645326ccab4ed5b65a6c7e7ef0d32 (diff) | |
download | vaadin-framework-aacb2f8289bc2faaab1225bd8b0dacd873d7839a.tar.gz vaadin-framework-aacb2f8289bc2faaab1225bd8b0dacd873d7839a.zip |
Position tooltips in the visible area (#15129).
Change-Id: If4f13a859fd2e6fc363781bf04e52f780206e9e1
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/VTooltip.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/VTooltip.java b/client/src/com/vaadin/client/VTooltip.java index edd1273bf5..2fb5a8a293 100644 --- a/client/src/com/vaadin/client/VTooltip.java +++ b/client/src/com/vaadin/client/VTooltip.java @@ -210,6 +210,10 @@ public class VTooltip extends VOverlay { x = Window.getClientWidth() - offsetWidth - MARGIN + Window.getScrollLeft(); } + // Do not allow x to be zero, for otherwise the tooltip does + // not close when the mouse is moved (see isTooltipOpen()). + int minX = Window.getScrollLeft() + MARGIN; + x = Math.max(x, minX); return x; } @@ -245,6 +249,10 @@ public class VTooltip extends VOverlay { y = Window.getScrollTop(); } } + // Do not allow y to be zero, for otherwise the tooltip does + // not close when the mouse is moved (see isTooltipOpen()). + int minY = Window.getScrollTop() + MARGIN; + y = Math.max(y, minY); return y; } }); |