aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/tickets/Ticket12727.java
blob: 40711c6b7fbdad4faa4e3689d9f46a0139779240 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
package com.vaadin.tests.tickets;

import java.util.ArrayList;

import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.ListSelect;
import com.vaadin.ui.Panel;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;

/**
 * Test for #12727: Panels get unnecessary scroll bars in WebKit when content is
 * 100% wide.
 */
@SuppressWarnings("serial")
public class Ticket12727 extends UI {

    @Override
    protected void init(VaadinRequest request) {
        Panel panel = new Panel();

        VerticalLayout content = new VerticalLayout();
        panel.setContent(content);

        GridLayout gridLayout = new GridLayout();
        gridLayout.setHeight(null);
        gridLayout.setWidth(100, Unit.PERCENTAGE);
        content.addComponent(gridLayout);

        ListSelect listSelect = new ListSelect();

        listSelect.setWidth(100, Unit.PERCENTAGE);
        listSelect.setHeight(500, Unit.PIXELS);

        gridLayout.addComponent(listSelect);

        ArrayList<String> values = new ArrayList<String>();
        values.add("Value 1");
        values.add("Value 2");
        values.add("Value 3");

        ComboBox comboBox = new ComboBox(null, values);
        gridLayout.addComponent(comboBox);

        gridLayout.setMargin(true);

        setContent(panel);
    }
}