primefaces / primereact

The Most Complete React UI Component Library
https://primereact.org
MIT License
6.99k stars 1.06k forks source link

Splitter/SplitterPanel: Unable to support divider dragging for more than two SplitterPanels in a Splitter component #6487

Closed pcioffi-rtts closed 7 months ago

pcioffi-rtts commented 7 months ago

Describe the bug

Having a Splitter component with three or more panels under it causes issues when using the dividers for resizing; the left-most divider seems to work/behave fine, but upon using the right-most divider causes the left-most panel to resize wrongly (see gif for clarification)

PrimeReactSplitterThreePanelIssue

Reproducer

https://stackblitz.com/edit/draygx-s1dwup?file=src%2FApp.jsx

PrimeReact version

10.6.3

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

KirilCycle commented 7 months ago

This happens because the 'onResizeEnd' method applies the wrong dimensions to the 'panelSizes' state. Let me try to fix it