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.

TooltipsOnScrollingWindow.java 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package com.vaadin.tests.components;
  2. import com.vaadin.tests.util.TestUtils;
  3. import com.vaadin.ui.CssLayout;
  4. import com.vaadin.ui.Label;
  5. public class TooltipsOnScrollingWindow extends TestBase {
  6. @Override
  7. protected void setup() {
  8. TestUtils.injectCSS(getMainWindow(),
  9. ".v-generated-body { overflow: auto; } "
  10. + ".v-app, .v-ui { overflow: visible !important;}"
  11. + ".hoverable-label { position: fixed; bottom: 10px; right: 10px; }"
  12. + ".hidden-label { position: absolute; top: 2000px; left: 2000px;}");
  13. getLayout().getParent().setHeight("4000px");
  14. getLayout().getParent().setWidth("4000px");
  15. getLayout().setHeight("4000px");
  16. getLayout().setWidth("4000px");
  17. CssLayout layout = new CssLayout();
  18. layout.setHeight("4000px");
  19. layout.setWidth("4000px");
  20. addComponent(layout);
  21. Label hoverableLabel = new Label("Hover me");
  22. hoverableLabel.setId("hoverable-label");
  23. hoverableLabel.setStyleName("hoverable-label");
  24. hoverableLabel.setWidth("-1px");
  25. hoverableLabel.setDescription("Tooltip");
  26. layout.addComponent(hoverableLabel);
  27. Label hiddenLabel = new Label("Hidden");
  28. hiddenLabel.setStyleName("hidden-label");
  29. hiddenLabel.setWidth("-1px");
  30. layout.addComponent(hiddenLabel);
  31. getMainWindow().scrollIntoView(hiddenLabel);
  32. }
  33. @Override
  34. protected String getDescription() {
  35. return "Tooltip is displayed in the wrong place when component is at lower edge of the screen and application with following the css is scrolled vertically.";
  36. }
  37. @Override
  38. protected Integer getTicketNumber() {
  39. return 9862;
  40. }
  41. }