diff options
author | John Alhroos <john.ahlroos@itmill.com> | 2010-08-06 06:55:03 +0000 |
---|---|---|
committer | John Alhroos <john.ahlroos@itmill.com> | 2010-08-06 06:55:03 +0000 |
commit | 0d5d3c136c30923f6addfb80d998de292d4850fa (patch) | |
tree | 44b77c38c76e21fcbaed7f163c57a19221c8747c /src/com | |
parent | 83e7ac457ec937ea89555b992de04dbd7d4fc761 (diff) | |
download | vaadin-framework-0d5d3c136c30923f6addfb80d998de292d4850fa.tar.gz vaadin-framework-0d5d3c136c30923f6addfb80d998de292d4850fa.zip |
Fix for #5396
svn changeset:14418/svn branch:6.4
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VTree.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/VTree.java index f5f30d70a8..bec2ed3aca 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTree.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTree.java @@ -23,7 +23,9 @@ import com.google.gwt.event.dom.client.KeyDownEvent; import com.google.gwt.event.dom.client.KeyDownHandler; import com.google.gwt.event.dom.client.KeyPressEvent; import com.google.gwt.event.dom.client.KeyPressHandler; +import com.google.gwt.user.client.Command; import com.google.gwt.user.client.DOM; +import com.google.gwt.user.client.DeferredCommand; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.Window; @@ -1450,11 +1452,23 @@ public class VTree extends SimpleFocusablePanel implements Paintable, node.setFocused(true); } + focusedNode = node; + if (node != null && scrollIntoView) { - node.scrollIntoView(); + /* + * Delay scrolling the focused node into view if we are still + * rendering. #5396 + */ + if (!rendering) { + node.scrollIntoView(); + } else { + DeferredCommand.addCommand(new Command() { + public void execute() { + focusedNode.scrollIntoView(); + } + }); + } } - - focusedNode = node; } /** |