Skip to content

scrollbar positioning is delayed in externalViewport + scrollViewport use cases due to lag in updateDimensions (v16+) #698

@sankarseran

Description

@sankarseran

Reproduction

Steps to Reproduce

  1. Update ngx-scrollbar to version 16.0.0 or more.
  2. Use the ng-scrollbar as shown below:
<ng-scrollbar
  class="table-container"
  externalViewport
  syncSpacer
  orientation="horizontal"
  (afterUpdate)="scrollbarAfterUpdate()"
>
  <div class="viewport-wrapper">
    <div scrollViewport>
      <ng-content select="sample-table, [sample-table]"></ng-content>
    </div>
  </div>
</ng-scrollbar>

Expected Behavior

When the table page size changes, the horizontal scrollbar should immediately reposition itself based on the contentWrapperElement without any delay or visual lag.

Actual Behavior

Currently, when the page size changes, there's a noticeable delay (a few seconds) before updateDimensions is triggered. During this time, the scrollbar remains stuck to the table’s previous dimensions, creating a flickering effect as it suddenly adjusts after the delay.

Environment

  • Angular: 19.x
  • ngx-scrollbar: after v16.0.0
  • Browser(s): chrome
  • Operating System: windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions