diff options
author | Johannes Tuikkala <johannes@vaadin.com> | 2015-03-05 13:32:33 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-03-24 15:53:22 +0000 |
commit | 1c569304b3f10960854c2045030d907408978d05 (patch) | |
tree | 9ff9a7ddd0b76f36320d1a3e6d317f122aae955e /client | |
parent | e3bf98708cb02e0772a46496ef8720657253e1ce (diff) | |
download | vaadin-framework-1c569304b3f10960854c2045030d907408978d05.tar.gz vaadin-framework-1c569304b3f10960854c2045030d907408978d05.zip |
Fixed scroll jump by using native focusing in IE (#15294)
Change-Id: I412ba219f31567ebba019b7d6ce4db4af9be9363
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/FocusableScrollPanel.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/ui/FocusableScrollPanel.java b/client/src/com/vaadin/client/ui/FocusableScrollPanel.java index 475c8f8074..9dd9c17675 100644 --- a/client/src/com/vaadin/client/ui/FocusableScrollPanel.java +++ b/client/src/com/vaadin/client/ui/FocusableScrollPanel.java @@ -48,9 +48,11 @@ public class FocusableScrollPanel extends SimpleFocusablePanel implements Style style = getElement().getStyle(); style.setProperty("zoom", "1"); style.setPosition(Position.RELATIVE); + browserInfo = BrowserInfo.get(); } private DivElement focusElement; + private BrowserInfo browserInfo; public FocusableScrollPanel(boolean useFakeFocusElement) { this(); @@ -72,6 +74,12 @@ public class FocusableScrollPanel extends SimpleFocusablePanel implements style.setPosition(Position.FIXED); style.setTop(0, Unit.PX); style.setLeft(0, Unit.PX); + if (browserInfo.isIE()) { + // for #15294: artificially hide little bit more the + // focusElement, otherwise IE will make the window to scroll + // into it when focused + style.setLeft(-999, Unit.PX); + } getElement().appendChild(focusElement); /* Sink from focusElemet too as focusa and blur don't bubble */ DOM.sinkEvents(focusElement, Event.FOCUSEVENTS); |