Skip to content

Window resize issue with Controlled component #868

@dumaixx

Description

@dumaixx

Describe the bug

Hey
When using react-split-pane (v3) in controlled mode (sizes stored in React state), the panels visually resize when the browser window (or container) is resized, while the component state (sizes array) remains unchanged. This differs from the demo example which shows “fixed” pixel sizes unless the user drags the divider. It was working correctly with the version 0.1.x

To Reproduce

Steps to reproduce the behavior:

  1. Go to sandbox example
  2. Resize the preview window
    2.1 Locally openning devTools and resizig window step is valid

Expected behavior

Left and Right Pane should not change their width

Environment

  • react-split-pane version: 3.0.4
  • React version: 18/19
  • Browser: Chrome/Edge
  • OS: Windows 11

Additional context

It's strange that your example here is working fine here
I've copied in my example exact code of styles and Controlled component example and it's not working the same, could not find differences
Min/max width is also ignored this case, I've tried to add them in style prop of Pane's, they start working, but after playing with window width and started resizing - calculation is broken, right pane starts to go under left one if I will drag divider too far

Thanks in advance

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions