diff options
3 files changed, 82 insertions, 0 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/VTooltip.java b/src/com/vaadin/terminal/gwt/client/VTooltip.java index ed8bd2eedd..974e2f1f32 100644 --- a/src/com/vaadin/terminal/gwt/client/VTooltip.java +++ b/src/com/vaadin/terminal/gwt/client/VTooltip.java @@ -72,6 +72,11 @@ public class VTooltip extends VOverlay { DOM.setStyleAttribute(description, "display", "none"); } if (hasContent) { + // Issue #8454: With IE7 the tooltips size is calculated based on + // the last tooltip's position, causing problems if the last one was + // in the right or bottom edge. For this reason the tooltip is moved + // first to 0,0 position so that the calculation goes correctly. + setPopupPosition(0, 0); setPopupPositionAndShow(new PositionCallback() { public void setPosition(int offsetWidth, int offsetHeight) { diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonTooltips.html b/tests/testbench/com/vaadin/tests/components/button/ButtonTooltips.html new file mode 100644 index 0000000000..13fdf52c76 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/button/ButtonTooltips.html @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="http://192.168.2.168:8888/" /> +<title>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.button.ButtonTooltips?restartApplication</td> + <td></td> +</tr> +<tr> + <td>showTooltip</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonTooltips::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td> + <td>0,0</td> +</tr> +<tr> + <td>showTooltip</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonTooltips::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>0,0</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td></td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonTooltips.java b/tests/testbench/com/vaadin/tests/components/button/ButtonTooltips.java new file mode 100644 index 0000000000..fa639918aa --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/button/ButtonTooltips.java @@ -0,0 +1,40 @@ +package com.vaadin.tests.components.button; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Alignment; +import com.vaadin.ui.Button; +import com.vaadin.ui.VerticalLayout; + +public class ButtonTooltips extends TestBase { + + @Override + protected String getDescription() { + return "Button tooltip's size gets messed up if moving from one tooltip to another before a timer expires."; + } + + @Override + protected Integer getTicketNumber() { + return 8454; + } + + @Override + protected void setup() { + VerticalLayout vl = new VerticalLayout(); + Button button = new Button("One"); + button.setDescription("long descidescidescpription"); + Button button2 = new Button("Two"); + button2.setDescription("Another"); + Button button3 = new Button("One"); + button3.setDescription("long descidescidescpription"); + Button button4 = new Button("Two"); + button4.setDescription("Another"); + vl.addComponent(button); + vl.addComponent(button2); + vl.addComponent(button3); + vl.addComponent(button4); + vl.setComponentAlignment(button, Alignment.TOP_RIGHT); + vl.setComponentAlignment(button2, Alignment.TOP_RIGHT); + addComponent(vl); + + } +} |