v3.6.2
This commit is contained in:
@@ -12,6 +12,7 @@ import './wcc-properties.js';
|
||||
import { type TTheme } from './wcc-properties.js';
|
||||
import { breakpoints } from '@design.estate/dees-domtools';
|
||||
import { WccFrame } from './wcc-frame.js';
|
||||
import { WccSidebar } from './wcc-sidebar.js';
|
||||
|
||||
/**
|
||||
* Get filtered and sorted items from a section
|
||||
@@ -491,10 +492,10 @@ export class WccDashboard extends DeesElement {
|
||||
if (this.scrollListenersAttached) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const wccFrame = await this.wccFrame;
|
||||
const wccSidebar = this.shadowRoot.querySelector('wcc-sidebar');
|
||||
|
||||
const wccSidebar = this.shadowRoot.querySelector('wcc-sidebar') as WccSidebar | null;
|
||||
|
||||
if (wccFrame) {
|
||||
// The frame element itself is the scrollable container
|
||||
wccFrame.addEventListener('scroll', () => {
|
||||
@@ -505,11 +506,14 @@ export class WccDashboard extends DeesElement {
|
||||
}
|
||||
|
||||
if (wccSidebar) {
|
||||
// The sidebar element itself is the scrollable container
|
||||
wccSidebar.addEventListener('scroll', () => {
|
||||
this.sidebarScrollY = wccSidebar.scrollTop;
|
||||
this.debouncedScrollUpdate();
|
||||
});
|
||||
// Use the sidebar's scrollable container (.menu element)
|
||||
const scrollContainer = wccSidebar.scrollableContainer;
|
||||
if (scrollContainer) {
|
||||
scrollContainer.addEventListener('scroll', () => {
|
||||
this.sidebarScrollY = scrollContainer.scrollTop;
|
||||
this.debouncedScrollUpdate();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -555,18 +559,21 @@ export class WccDashboard extends DeesElement {
|
||||
if (this.scrollPositionsApplied) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const wccFrame = await this.wccFrame;
|
||||
const wccSidebar = this.shadowRoot.querySelector('wcc-sidebar');
|
||||
|
||||
const wccSidebar = this.shadowRoot.querySelector('wcc-sidebar') as WccSidebar | null;
|
||||
|
||||
if (wccFrame && this.frameScrollY > 0) {
|
||||
// The frame element itself is the scrollable container
|
||||
wccFrame.scrollTop = this.frameScrollY;
|
||||
}
|
||||
|
||||
if (wccSidebar && this.sidebarScrollY > 0) {
|
||||
// The sidebar element itself is the scrollable container
|
||||
wccSidebar.scrollTop = this.sidebarScrollY;
|
||||
// Use the sidebar's scrollable container (.menu element)
|
||||
const scrollContainer = wccSidebar.scrollableContainer;
|
||||
if (scrollContainer) {
|
||||
scrollContainer.scrollTop = this.sidebarScrollY;
|
||||
}
|
||||
}
|
||||
|
||||
this.scrollPositionsApplied = true;
|
||||
|
||||
Reference in New Issue
Block a user