You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

OverlayTouchScrolling.java 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.tests.overlays;
  5. import com.vaadin.server.VaadinRequest;
  6. import com.vaadin.tests.components.AbstractReindeerTestUI;
  7. import com.vaadin.ui.Button;
  8. import com.vaadin.ui.Component;
  9. import com.vaadin.ui.CssLayout;
  10. import com.vaadin.ui.Label;
  11. import com.vaadin.ui.Notification;
  12. public class OverlayTouchScrolling extends AbstractReindeerTestUI {
  13. @Override
  14. protected void setup(VaadinRequest request) {
  15. final CssLayout green = new CssLayout();
  16. green.setSizeFull();
  17. final CssLayout layout = new CssLayout() {
  18. @Override
  19. protected String getCss(Component c) {
  20. return "background:green;";
  21. }
  22. };
  23. layout.setSizeFull();
  24. layout.addComponent(green);
  25. setContent(layout);
  26. Button button = new Button("Tap me with a touch device");
  27. button.addClickListener(event -> {
  28. Notification
  29. .show("Now close this and you can scroll in mad places.");
  30. green.addComponent(new Label(
  31. "Thank you for clicking, now scroll (with touch device) to area without green background, which shouldn't be possible."));
  32. });
  33. green.addComponent(button);
  34. }
  35. @Override
  36. protected String getTestDescription() {
  37. return "Using overlays breaks top level scrolling on touch devices";
  38. }
  39. @Override
  40. protected Integer getTicketNumber() {
  41. return 10860;
  42. }
  43. }