@@ -488,7 +488,7 @@ public class WidgetUtil { | |||
final int scrollleft = elem.getScrollLeft(); | |||
elem.getStyle().setProperty("overflow", "hidden"); | |||
Scheduler.get().scheduleDeferred(() -> { | |||
Scheduler.get().scheduleFinally(() -> { | |||
// Dough, Safari scroll auto means actually just a moped | |||
elem.getStyle().setProperty("overflow", originalOverflow); | |||
if (!originalOverflowX.isEmpty()) { |
@@ -54,6 +54,7 @@ import com.vaadin.client.BrowserInfo; | |||
import com.vaadin.client.ComponentConnector; | |||
import com.vaadin.client.ConnectorMap; | |||
import com.vaadin.client.Focusable; | |||
import com.vaadin.client.HasComponentsConnector; | |||
import com.vaadin.client.LayoutManager; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.debug.internal.VDebugWindow; | |||
@@ -633,6 +634,15 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, | |||
*/ | |||
WidgetUtil | |||
.runWebkitOverflowAutoFix(contents.getFirstChildElement()); | |||
Scheduler.get().scheduleFinally(() -> { | |||
List<ComponentConnector> childComponents = ((HasComponentsConnector) ConnectorMap | |||
.get(client).getConnector(this)).getChildComponents(); | |||
if (!childComponents.isEmpty()) { | |||
LayoutManager layoutManager = getLayoutManager(); | |||
layoutManager.setNeedsMeasure(childComponents.get(0)); | |||
layoutManager.layoutNow(); | |||
} | |||
}); | |||
} | |||
} | |||
@@ -0,0 +1,41 @@ | |||
package com.vaadin.tests.components.window; | |||
import java.util.Arrays; | |||
import com.vaadin.annotations.Widgetset; | |||
import com.vaadin.server.VaadinRequest; | |||
import com.vaadin.tests.components.AbstractTestUI; | |||
import com.vaadin.ui.TwinColSelect; | |||
import com.vaadin.ui.Window; | |||
@Widgetset("com.vaadin.DefaultWidgetSet") | |||
public class WindowTwinColSelect extends AbstractTestUI { | |||
@Override | |||
protected void setup(VaadinRequest request) { | |||
final TwinColSelect<String> testScroll = new TwinColSelect<>(); | |||
testScroll.setItems(Arrays.asList("Option1", "Option2")); | |||
testScroll.setRows(10); | |||
testScroll.setSizeFull(); | |||
testScroll.setHeightUndefined(); | |||
Window window = new Window(); | |||
window.setHeight("200px"); | |||
window.setWidth("400px"); | |||
window.setModal(true); | |||
window.setContent(testScroll); | |||
addWindow(window); | |||
window.center(); | |||
} | |||
@Override | |||
protected String getTestDescription() { | |||
return "Scroll bar shouldn't interfere with how " | |||
+ "full-size TwinColSelect contents are displayed."; | |||
} | |||
@Override | |||
protected Integer getTicketNumber() { | |||
return 10652; | |||
} | |||
} |
@@ -3,8 +3,11 @@ package com.vaadin.tests.components.window; | |||
import static com.vaadin.tests.components.window.ComboboxScrollableWindow.COMBOBOX_ID; | |||
import static com.vaadin.tests.components.window.ComboboxScrollableWindow.WINDOW_ID; | |||
import java.util.List; | |||
import org.junit.Test; | |||
import org.openqa.selenium.WebElement; | |||
import org.openqa.selenium.remote.DesiredCapabilities; | |||
import com.vaadin.testbench.By; | |||
import com.vaadin.testbench.commands.TestBenchElementCommands; | |||
@@ -19,6 +22,12 @@ import com.vaadin.tests.tb3.MultiBrowserTest; | |||
*/ | |||
public class ComboboxScrollableWindowTest extends MultiBrowserTest { | |||
@Override | |||
public List<DesiredCapabilities> getBrowsersToTest() { | |||
// Fix to #10652 broke this for PhantomJS | |||
return getBrowsersExcludingPhantomJS(); | |||
} | |||
@Test | |||
public void testWindowScrollbars() throws Exception { | |||
openTestURL(); |
@@ -0,0 +1,47 @@ | |||
package com.vaadin.tests.components.window; | |||
import static org.hamcrest.CoreMatchers.is; | |||
import static org.junit.Assert.assertThat; | |||
import static org.junit.Assert.assertTrue; | |||
import org.junit.Test; | |||
import org.openqa.selenium.WebElement; | |||
import org.openqa.selenium.interactions.Actions; | |||
import com.vaadin.testbench.By; | |||
import com.vaadin.testbench.elements.TwinColSelectElement; | |||
import com.vaadin.tests.tb3.MultiBrowserTest; | |||
public class WindowTwinColSelectTest extends MultiBrowserTest { | |||
@Test | |||
public void testBothVisibleInitially() { | |||
openTestURL(); | |||
TwinColSelectElement twinColSelect = $(TwinColSelectElement.class) | |||
.first(); | |||
WebElement optionsElement = twinColSelect.getOptionsElement(); | |||
WebElement selectionsElement = twinColSelect.getSelectionsElement(); | |||
assertTrue(optionsElement.isDisplayed()); | |||
assertTrue(selectionsElement.isDisplayed()); | |||
assertThat(selectionsElement.getLocation().getY(), | |||
is(optionsElement.getLocation().getY())); | |||
} | |||
@Test | |||
public void testBothVisibleAfterResize() { | |||
openTestURL(); | |||
waitForElementPresent(By.className("v-window-resizebox")); | |||
TwinColSelectElement twinColSelect = $(TwinColSelectElement.class) | |||
.first(); | |||
new Actions(getDriver()) | |||
.moveToElement(findElement(By.className("v-window-resizebox"))) | |||
.clickAndHold().moveByOffset(-30, -30).release().build() | |||
.perform(); | |||
WebElement optionsElement = twinColSelect.getOptionsElement(); | |||
WebElement selectionsElement = twinColSelect.getSelectionsElement(); | |||
assertTrue(optionsElement.isDisplayed()); | |||
assertTrue(selectionsElement.isDisplayed()); | |||
assertThat(selectionsElement.getLocation().getY(), | |||
is(optionsElement.getLocation().getY())); | |||
} | |||
} |