fix(wcc-dashboard): Prevent duplicate application of scroll positions in dashboard to avoid interfering with user scrolling
This commit is contained in:
@ -44,6 +44,8 @@ export class WccDashboard extends DeesElement {
|
||||
@property()
|
||||
public sidebarScrollY: number = 0;
|
||||
|
||||
private scrollPositionsApplied: boolean = false;
|
||||
|
||||
@queryAsync('wcc-frame')
|
||||
public wccFrame: Promise<WccFrame>;
|
||||
|
||||
@ -268,6 +270,11 @@ export class WccDashboard extends DeesElement {
|
||||
}
|
||||
|
||||
public async applyScrollPositions() {
|
||||
// Only apply scroll positions once to avoid interfering with user scrolling
|
||||
if (this.scrollPositionsApplied) {
|
||||
return;
|
||||
}
|
||||
|
||||
const wccFrame = await this.wccFrame;
|
||||
const wccSidebar = this.shadowRoot.querySelector('wcc-sidebar');
|
||||
|
||||
@ -280,5 +287,7 @@ export class WccDashboard extends DeesElement {
|
||||
// The sidebar element itself is the scrollable container
|
||||
wccSidebar.scrollTop = this.sidebarScrollY;
|
||||
}
|
||||
|
||||
this.scrollPositionsApplied = true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user