summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonatan Kronqvist <jonatan@vaadin.com>2014-03-28 14:48:26 +0200
committerJonatan Kronqvist <jonatan@vaadin.com>2014-03-28 14:48:26 +0200
commita8c2c7b4a83b839dbf3b6540ed328793efb1dedd (patch)
treef69a3207927c1be6e72d4e4ad0912890b9f489b9
parent9d253245e848440955ab608004900c296d74c833 (diff)
parentca73546d736dfb41d9b25a32282fff63791bffe1 (diff)
downloadvaadin-framework-a8c2c7b4a83b839dbf3b6540ed328793efb1dedd.tar.gz
vaadin-framework-a8c2c7b4a83b839dbf3b6540ed328793efb1dedd.zip
Merge commit 'ca73546d736dfb41d9b25a32282fff63791bffe1' into master
ca73546d Eliminate more .v-caption leaks in AbstractOrderedLayout (#13346) Conflicts: client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java Change-Id: Id1916a312149728d69b1493a9f28a72de41ec711
-rw-r--r--client/src/com/vaadin/client/ui/VCalendarPanel.java8
-rw-r--r--client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java4
-rw-r--r--uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEsc.java6
-rw-r--r--uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEscTest.java33
-rw-r--r--uitest/src/com/vaadin/tests/push/ReconnectTest.java16
5 files changed, 41 insertions, 26 deletions
diff --git a/client/src/com/vaadin/client/ui/VCalendarPanel.java b/client/src/com/vaadin/client/ui/VCalendarPanel.java
index 84151ca67e..74462e501d 100644
--- a/client/src/com/vaadin/client/ui/VCalendarPanel.java
+++ b/client/src/com/vaadin/client/ui/VCalendarPanel.java
@@ -1090,12 +1090,18 @@ public class VCalendarPanel extends FocusableFlexTable implements
* The keydown/keypress event
*/
private void handleKeyPress(DomEvent<?> event) {
+ // Special handling for events from time ListBoxes.
if (time != null
&& time.getElement().isOrHasChild(
(Node) event.getNativeEvent().getEventTarget().cast())) {
int nativeKeyCode = event.getNativeEvent().getKeyCode();
if (nativeKeyCode == getSelectKey()) {
- onSubmit(); // submit happens if enter key hit down on listboxes
+ onSubmit(); // submit if enter key hit down on listboxes
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ if (nativeKeyCode == getCloseKey()) {
+ onCancel(); // cancel if ESC key hit down on listboxes
event.preventDefault();
event.stopPropagation();
}
diff --git a/client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java b/client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java
index 2206aebaca..fbf94f0da3 100644
--- a/client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java
+++ b/client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java
@@ -262,6 +262,10 @@ public abstract class AbstractOrderedLayoutConnector extends
}
boolean enabled = child.isEnabled();
+ if (slot.hasCaption() && null == caption) {
+ slot.setCaptionResizeListener(null);
+ }
+
slot.setCaption(caption, icon, styles, error, showError, required,
enabled);
diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEsc.java b/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEsc.java
index af43f143c1..f1422b28a3 100644
--- a/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEsc.java
+++ b/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEsc.java
@@ -25,6 +25,10 @@ public class PopupClosingWithEsc extends AbstractTestUI {
@Override
protected void setup(VaadinRequest request) {
+ DateField df0 = new DateField("Minute");
+ df0.setId("minute");
+ df0.setResolution(Resolution.MINUTE);
+
DateField df1 = new DateField("Day");
df1.setId("day");
df1.setResolution(Resolution.DAY);
@@ -40,7 +44,7 @@ public class PopupClosingWithEsc extends AbstractTestUI {
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
layout.setSpacing(true);
- layout.addComponents(df1, df2, df3);
+ layout.addComponents(df0, df1, df2, df3);
setContent(layout);
}
diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEscTest.java b/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEscTest.java
index 4c4b894b2b..834517e1bb 100644
--- a/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEscTest.java
+++ b/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEscTest.java
@@ -22,13 +22,27 @@ import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
-import org.openqa.selenium.interactions.Actions;
import com.vaadin.tests.tb3.MultiBrowserTest;
public class PopupClosingWithEscTest extends MultiBrowserTest {
@Test
+ public void testPopupClosingFromTimeSelect() {
+ openTestURL();
+
+ openPopup("minute");
+ assertTrue(isPopupVisible());
+
+ // Send ESC to the select element to simulate user being
+ // focused on the select while hitting the ESC key.
+ WebElement select = driver.findElement(By
+ .cssSelector(".v-datefield-popup select:first-child"));
+ select.sendKeys(Keys.ESCAPE);
+ assertFalse(isPopupVisible());
+ }
+
+ @Test
public void testPopupClosingDayResolution() {
testPopupClosing("day");
}
@@ -46,22 +60,25 @@ public class PopupClosingWithEscTest extends MultiBrowserTest {
private void testPopupClosing(String dateFieldId) {
openTestURL();
- driver.findElement(
- vaadinLocator("PID_S" + dateFieldId + "#popupButton")).click();
+ openPopup(dateFieldId);
assertTrue(isPopupVisible());
- sendEsc();
+ sendEscToCalendarPanel();
assertFalse(isPopupVisible());
}
+ private void openPopup(String dateFieldId) {
+ driver.findElement(
+ vaadinLocator("PID_S" + dateFieldId + "#popupButton")).click();
+ }
+
private boolean isPopupVisible() {
return !(driver.findElements(By.cssSelector(".v-datefield-popup"))
.isEmpty());
}
- private void sendEsc() {
- WebElement elem = driver.findElement(By
- .cssSelector(".v-datefield-calendarpanel"));
- new Actions(driver).sendKeys(elem, Keys.ESCAPE).perform();
+ private void sendEscToCalendarPanel() {
+ driver.findElement(By.cssSelector(".v-datefield-calendarpanel"))
+ .sendKeys(Keys.ESCAPE);
}
}
diff --git a/uitest/src/com/vaadin/tests/push/ReconnectTest.java b/uitest/src/com/vaadin/tests/push/ReconnectTest.java
index 69b2ccf22b..5938ab1ff5 100644
--- a/uitest/src/com/vaadin/tests/push/ReconnectTest.java
+++ b/uitest/src/com/vaadin/tests/push/ReconnectTest.java
@@ -122,22 +122,6 @@ public abstract class ReconnectTest extends MultiBrowserTestWithProxy {
}
}
- @Test
- public void testMultipleQuickReconnects() throws Exception {
- setDebug(true);
- openTestURL();
- startTimer();
- waitUntilServerCounterChanges();
- for (int i = 0; i < 50; i++) {
- disconnectProxy();
- Thread.sleep(100);
- connectProxy();
- Thread.sleep(100);
- }
- waitUntilServerCounterChanges();
- waitUntilServerCounterChanges();
- }
-
private int getClientCounter() {
return BasicPushTest.getClientCounter(this);
}