Skip to content

Commit 62e7222

Browse files
YoshiWalshJoshua WalshThomaash
authored
fix(timeline): significantly reduce unexpected vertical jumping when moving the timeline (#1677)
* Significantly reduce unexpected vertical jumping when moving the timeline * style(timeline): remove unnecessary indent change --------- Co-authored-by: Joshua Walsh <[email protected]> Co-authored-by: Tomina <[email protected]>
1 parent e2ad6f8 commit 62e7222

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/timeline/component/Group.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class Group {
3232
this.subgroupOrderer = data && data.subgroupOrder;
3333
this.itemSet = itemSet;
3434
this.isVisible = null;
35+
this.height = 0;
3536
this.stackDirty = true; // if true, items will be restacked on next redraw
3637

3738
// This is a stack of functions (`() => void`) that will be executed before
@@ -537,7 +538,7 @@ class Group {
537538
this._updateSubgroupsSizes.bind(this),
538539

539540
() => {
540-
height = this._calculateHeight.bind(this)(margin);
541+
height = this.height = this._calculateHeight.bind(this)(margin);
541542
},
542543

543544
// calculate actual size and position again
@@ -627,7 +628,9 @@ class Group {
627628
items = this.visibleItems;
628629
}
629630

630-
if (items.length > 0) {
631+
if(!this.isVisible && this.height) {
632+
height = Math.max(this.height, this.props.label.height);
633+
} else if (items.length > 0) {
631634
let min = items[0].top;
632635
let max = items[0].top + items[0].height;
633636
util.forEach(items, item => {

0 commit comments

Comments
 (0)