From ce9c818b8c1cd290747d841166008898187e7a58 Mon Sep 17 00:00:00 2001 From: John Alhroos Date: Tue, 30 Apr 2013 07:48:53 +0000 Subject: [PATCH] Instead of applying workaround to the root panel, apply it to the sub window content element instead to prevent scrolling of the document when a sub window is removed. #11713 (#10776) svn changeset:25899/svn branch:6.8 Change-Id: Ib3cb61e024ba461bcc146b9beb4a52cb6df9ce28 --- client/src/com/vaadin/client/ui/VWindow.java | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/client/src/com/vaadin/client/ui/VWindow.java b/client/src/com/vaadin/client/ui/VWindow.java index fd2a701334..51a775cb7e 100644 --- a/client/src/com/vaadin/client/ui/VWindow.java +++ b/client/src/com/vaadin/client/ui/VWindow.java @@ -419,14 +419,6 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, @Override public void hide() { - if (vaadinModality) { - hideModalityCurtain(); - } - super.hide(); - - // Remove window from windowOrder to avoid references being left - // hanging. - windowOrder.remove(this); /* * If the window has a RichTextArea and the RTA is focused at the time @@ -443,20 +435,28 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, if (BrowserInfo.get().isIE8()) { fixIE8FocusCaptureIssue(); } + + if (vaadinModality) { + hideModalityCurtain(); + } + super.hide(); + + // Remove window from windowOrder to avoid references being left + // hanging. + windowOrder.remove(this); } private void fixIE8FocusCaptureIssue() { Element e = DOM.createInputText(); Style elemStyle = e.getStyle(); elemStyle.setPosition(Position.ABSOLUTE); - elemStyle.setLeft(-10, Unit.PX); + elemStyle.setTop(-10, Unit.PX); elemStyle.setWidth(0, Unit.PX); elemStyle.setHeight(0, Unit.PX); - Element rootPanel = RootPanel.getBodyElement(); - rootPanel.appendChild(e); + contentPanel.getElement().appendChild(e); e.focus(); - rootPanel.removeChild(e); + contentPanel.getElement().removeChild(e); } /** For internal use only. May be removed or replaced in the future. */ -- 2.39.5