Skip to content

Commit

Permalink
[tree] fix scroll behavior when selecting or expanding a node
Browse files Browse the repository at this point in the history
Fixes: #3347
Fixes: #1593

Addressed the issue where the scroll jumps up when manually scrolled and
selected a node.

Signed-off-by: Anas Shahid <muhammad.shahid@ericsson.com>
  • Loading branch information
Anas Shahid committed Jul 9, 2020
1 parent fd9d8ec commit 13b1492
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/core/src/browser/tree/tree-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,12 @@ export class TreeWidget extends ReactWidget implements StatefulWidget {
protected forceUpdate({ resize }: TreeWidget.ForceUpdateOptions = { resize: true }): void {
if (this.view && this.view.list) {
if (resize && this.isVisible) {
this.view.cache.clearAll();
const rowIndex = this.getScrollToRow();
if (rowIndex !== undefined) {
this.view.cache.clear(rowIndex, 0);
} else {
this.view.cache.clearAll();
}
this.view.list.recomputeRowHeights();
} else {
this.view.list.forceUpdateGrid();
Expand Down

0 comments on commit 13b1492

Please sign in to comment.