summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/testbench/com/vaadin/tests/components/select/FocusListenerBreaksDropdownMenu.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/testbench/com/vaadin/tests/components/select/FocusListenerBreaksDropdownMenu.java b/tests/testbench/com/vaadin/tests/components/select/FocusListenerBreaksDropdownMenu.java
new file mode 100644
index 0000000000..dd2a8bb1a8
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/select/FocusListenerBreaksDropdownMenu.java
@@ -0,0 +1,37 @@
+package com.vaadin.tests.components.select;
+
+import com.vaadin.event.FieldEvents;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.ComboBox;
+
+public class FocusListenerBreaksDropdownMenu extends TestBase {
+
+ @Override
+ protected void setup() {
+ final ComboBox comboBox = new ComboBox();
+ for (int i = 0; i < 5; ++i) {
+ comboBox.addItem("Item " + i);
+ }
+
+ comboBox.addListener(new FieldEvents.FocusListener() {
+ public void focus(FieldEvents.FocusEvent event) {
+ comboBox.addItem();
+ }
+ });
+
+ comboBox.setImmediate(true);
+ addComponent(comboBox);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Clicking the dropdown arrow on a not-already-focused ComboBox "
+ + "breaks the dropdown list if a FocusListener adds or removes items";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 8321;
+ }
+
+}