Skip to content

Commit

Permalink
Trigger stickyChange when attaching viewport (#129)
Browse files Browse the repository at this point in the history
- Fixes an issue in chromium browsers where:
-- If the table has a sticky header and stickyPositions is not yet initialized
-- And a scrollToIndex is issued to an index outside the current range
-- The browser triggers a second scroll event when initializing the sticky elements, possibly messing up the scrolling and not showing the index issued to scrollToIndex
  • Loading branch information
raphael-inglin-ergon authored Mar 13, 2024
1 parent 003365d commit ce9730b
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export class FixedSizeTableVirtualScrollStrategy implements VirtualScrollStrateg
public attach(viewport: CdkVirtualScrollViewport): void {
this.viewport = viewport;
this.viewport.renderedRangeStream.subscribe(this.renderedRangeStream);
this.stickyChange.next(0);
this.onDataLengthChanged();
}

Expand Down

0 comments on commit ce9730b

Please sign in to comment.