Skip to content

Panel does not respect max width when moved (resizes to 50%) #1230

@janvorisek

Description

@janvorisek

Description

When using Dockview to implement a sidebar-style layout (similar to the Explorer panel in VS Code), panel sizing behavior becomes inconsistent when repositioning panels.

Problem

I have a narrow sidebar panel (~200px width, maxWidth set to 300px) alongside a main content panel that occupies the remaining space.

When I drag the sidebar panel from the left side to the right side:

  • Both panels are resized to ~50% of the container width
  • The sidebar panel exceeds its configured maxWidth

This breaks expected layout constraints and results in unusable UI proportions.

Expected Behavior

  • The sidebar panel should retain its width (or respect maxWidth) when moved
  • The main panel should absorb the remaining available space
  • Panel movement should not implicitly trigger proportional redistribution if constraints are defined

Actual Behavior

  • Panels are resized evenly (50/50 split), ignoring maxWidth
  • Sidebar becomes significantly wider than intended

Environment

  • Framework: Vue

Proposed Solution

When reordering panels:

  • Preserve existing panel sizes where constraints (maxWidth, minWidth) are defined
  • Apply proportional resizing only when no explicit constraints exist
  • Alternatively, introduce an option like:
    preservePanelSizeOnMove: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions