Skip to content

Commit

Permalink
Resize item visibility fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bbazukun123 committed Mar 18, 2024
1 parent 4c2e8cc commit fd1189e
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/ScrollBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,6 @@ export class ScrollBox extends Container

this.lastWidth = this.listWidth;
this.lastHeight = this.listHeight;

if (this._dimensionChanged)
{
this.list.arrangeChildren();
this._dimensionChanged = false;
}
}

if (this._trackpad)
Expand Down Expand Up @@ -537,7 +531,17 @@ export class ScrollBox extends Container
}
}

this.updateVisibleItems();
if (this._dimensionChanged)
{
this.list.arrangeChildren();

// Since the scrolling adjustment can happen due to the resize,
// we shouldn't update the visible items immediately.
this.stopRenderHiddenItems();

this._dimensionChanged = false;
}
else this.updateVisibleItems();
}

protected onMouseScroll(event: WheelEvent): void
Expand Down

0 comments on commit fd1189e

Please sign in to comment.