fix(sidebar): disable frame CSS transition while user is resizing the sidebar to prevent janky animations

This commit is contained in:
2026-01-04 11:31:02 +00:00
parent 61b79aa4dc
commit 9ed614994f
4 changed files with 22 additions and 2 deletions

View File

@@ -768,6 +768,11 @@ export class WccSidebar extends DeesElement {
const frame = this.dashboardRef?.shadowRoot?.querySelector('wcc-frame') as any;
const properties = this.dashboardRef?.shadowRoot?.querySelector('wcc-properties') as any;
// Disable frame transition during resize
if (frame) {
frame.isResizing = true;
}
const onMouseMove = (e: MouseEvent) => {
const newWidth = Math.min(400, Math.max(150, startWidth + (e.clientX - startX)));
this.sidebarWidth = newWidth;
@@ -784,6 +789,10 @@ export class WccSidebar extends DeesElement {
this.isResizing = false;
document.removeEventListener('mousemove', onMouseMove);
document.removeEventListener('mouseup', onMouseUp);
// Re-enable frame transition
if (frame) {
frame.isResizing = false;
}
// Dispatch event on release for URL persistence
this.dispatchEvent(new CustomEvent('widthChanged', { detail: this.sidebarWidth }));
};