aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxCursorPositionReset.java
blob: 034ffcc6d8bfb48182aa5faa5c2c00519b4fd428 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.vaadin.tests.components.combobox;

import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;

public class ComboBoxCursorPositionReset extends AbstractReindeerTestUI {

    @Override
    protected void setup(VaadinRequest request) {
        final HorizontalLayout root = new HorizontalLayout();
        root.setSizeFull();
        setContent(root);

        ComboBox<String> combo = new ComboBox<>();
        root.addComponent(combo);
        combo.setItems("Hello World", "Please click on the text");

        combo.setValue("Please click on the text");
        Label gap = new Label();
        root.addComponent(gap);
        root.setExpandRatio(gap, 1);

    }

    @Override
    protected String getTestDescription() {
        return "Clicking on the text in the ComboBox should position the caret where you clicked, not cause it to jump to the start or the end";
    }

    @Override
    protected Integer getTicketNumber() {
        return 11152;
    }

}