]> source.dussan.org Git - vaadin-framework.git/commitdiff
Test case and fix for #6784
authorJonatan Kronqvist <jonatan.kronqvist@itmill.com>
Thu, 7 Apr 2011 07:43:26 +0000 (07:43 +0000)
committerJonatan Kronqvist <jonatan.kronqvist@itmill.com>
Thu, 7 Apr 2011 07:43:26 +0000 (07:43 +0000)
svn changeset:18144/svn branch:6.5

src/com/vaadin/terminal/gwt/client/ui/VWindow.java
tests/src/com/vaadin/tests/components/window/HugeWindowShouldBeClosable.java [new file with mode: 0644]

index c564a594234bd0f70d95e7eca55996c2f0f3ec5e..67d90d356423ac0bffc405f40b18ca88a4fc4073 100644 (file)
@@ -903,7 +903,8 @@ public class VWindow extends VOverlay implements Container,
              * After that this windows e.g. gets all keyboard shortcuts.
              */
             if (type == Event.ONMOUSEDOWN
-                    && !DOM.isOrHasChild(contentPanel.getElement(), target)) {
+                    && !DOM.isOrHasChild(contentPanel.getElement(), target)
+                    && target != closeBox) {
                 contentPanel.focus();
             }
         }
diff --git a/tests/src/com/vaadin/tests/components/window/HugeWindowShouldBeClosable.java b/tests/src/com/vaadin/tests/components/window/HugeWindowShouldBeClosable.java
new file mode 100644 (file)
index 0000000..3075773
--- /dev/null
@@ -0,0 +1,27 @@
+package com.vaadin.tests.components.window;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Window;
+
+public class HugeWindowShouldBeClosable extends TestBase {
+
+    @Override
+    protected void setup() {
+        Window w = new Window("Hueg");
+        w.setWidth("2000px");
+        w.setHeight("2000px");
+        w.setPositionY(500);
+        getMainWindow().addWindow(w);
+    }
+
+    @Override
+    protected String getDescription() {
+        return "Huge windows should be closable";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return -1;
+    }
+
+}