Fix scrolling when NavigationTable is not in ScrollPanel
When NavigationTable is rooted in the browser window (and not within a ScrollPanel) it trusted the GWT native scrollIntoView() method to make the requested row visible within the viewable region. This does not work, possibly due to GWT bug 7762 [1]. Mozilla documentation [2] indicates scrollIntoView() is available in most browsers including Chrome 1.0, Firefox 1.0, IE6, Opera 10 and Safari 4. When there is no ScrollPanel to rely on use the DOM method and hope for the best. [1] https://code.google.com/p/google-web-toolkit/issues/detail?id=7762 [2] https://developer.mozilla.org/en-US/docs/Web/API/element.scrollIntoView Change-Id: Ibb742677c300e70a29f0b250415f979810c8386f
This commit is contained in:
@@ -231,10 +231,13 @@ public abstract class NavigationTable<RowItem> extends FancyFlexTable<RowItem> {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
tr.scrollIntoView();
|
||||
scrollIntoView0(tr);
|
||||
}
|
||||
}
|
||||
|
||||
private static final native void scrollIntoView0(Element e)
|
||||
/*-{ if (e.scrollIntoView) e.scrollIntoView() }-*/;
|
||||
|
||||
protected void movePointerTo(final Object oldId) {
|
||||
final int row = findRow(oldId);
|
||||
if (0 <= row) {
|
||||
|
||||
Reference in New Issue
Block a user