Don't scroll into view focused controls bigger than the viewport
When website-like scrolling is enabled, focusing by mouse of controls
with bigger dimensions than the viewport (like main shell or navigation
table) leads to unwanted scrolling as Widget.js#scrollIntoView is
called.
Scroll into view only controls that fit into the viewport.
Change-Id: Ic1a7759b19d5908be5b1e300b84417e9e6c78b87
diff --git a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/Widget.js b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/Widget.js
index 62bc937..2e6f8f5 100644
--- a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/Widget.js
+++ b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/Widget.js
@@ -3116,7 +3116,12 @@
if (value) {
vFocusRoot.setFocusedChild(this);
this._visualizeFocus();
- this.scrollIntoView();
+ if( this.getWidth() < rwt.html.Viewport.getWidth() ) {
+ this.scrollIntoViewX();
+ }
+ if( this.getHeight() < rwt.html.Viewport.getHeight() ) {
+ this.scrollIntoViewY();
+ }
} else {
if (vFocusRoot.getFocusedChild() == this) {
vFocusRoot.setFocusedChild(null);