From 432ae391e1f5e6dd6cd337a6d64aaf7fafce39c6 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Thu, 29 Jan 2026 16:25:57 -0500 Subject: [PATCH 1/4] Remove aria-orientation from Group element (#641) Resolves #640 --- lib/components/group/Group.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/components/group/Group.tsx b/lib/components/group/Group.tsx index a96e4a420..8b992a137 100644 --- a/lib/components/group/Group.tsx +++ b/lib/components/group/Group.tsx @@ -314,7 +314,6 @@ export function Group({
Date: Thu, 29 Jan 2026 17:02:11 -0500 Subject: [PATCH 2/4] Fix collapsible Panel regression (#642) Resolves #639 --- lib/global/utils/adjustLayoutByDelta.ts | 40 ++++++++++++++++++------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/lib/global/utils/adjustLayoutByDelta.ts b/lib/global/utils/adjustLayoutByDelta.ts index 33cc46f78..878534051 100644 --- a/lib/global/utils/adjustLayoutByDelta.ts +++ b/lib/global/utils/adjustLayoutByDelta.ts @@ -146,27 +146,47 @@ export function adjustLayoutByDelta({ const { collapsible, collapsedSize, minSize } = panelConstraints; if (collapsible) { - // DEBUG.push(` -> collapsible panel`); - // DEBUG.push(` -> halfway point: ${halfwayPoint}`); + const isSecondPanel = index === secondPivotIndex; + + // DEBUG.push(` -> collapsible ${isSecondPanel ? "2nd" : "1st"} panel`); if (delta > 0) { const gapSize = minSize - collapsedSize; const halfwayPoint = gapSize / 2; + // DEBUG.push(` -> halfway point: ${halfwayPoint}`); + // DEBUG.push(` -> between collapsed: ${collapsedSize}`); + // DEBUG.push(` -> and min: ${minSize}`); if (compareLayoutNumbers(delta, minSize) < 0) { + // DEBUG.push(` -> adjusting delta from: ${delta}`); delta = compareLayoutNumbers(delta, halfwayPoint) <= 0 ? 0 : gapSize; - // DEBUG.push(` -> adjusting delta for collapse: ${delta}`); + // DEBUG.push(` -> adjusting delta to: ${delta}`); } } else { const gapSize = minSize - collapsedSize; const halfwayPoint = 100 - gapSize / 2; - - if (compareLayoutNumbers(100 + delta, minSize) > 0) { - delta = - compareLayoutNumbers(100 + delta, halfwayPoint) > 0 - ? 0 - : -gapSize; - // DEBUG.push(` -> adjusting delta for collapse: ${delta}`); + // DEBUG.push(` -> halfway point: ${halfwayPoint}`); + // DEBUG.push(` -> between collapsed: ${100 - collapsedSize}`); + // DEBUG.push(` -> and min: ${100 - minSize}`); + + if (isSecondPanel) { + if (compareLayoutNumbers(Math.abs(delta), minSize) < 0) { + // DEBUG.push(` -> adjusting delta from: ${delta}`); + delta = + compareLayoutNumbers(100 + delta, halfwayPoint) > 0 + ? 0 + : -gapSize; + // DEBUG.push(` -> adjusting delta to: ${delta}`); + } + } else { + if (compareLayoutNumbers(100 + delta, minSize) < 0) { + // DEBUG.push(` -> adjusting delta from: ${delta}`); + delta = + compareLayoutNumbers(100 + delta, halfwayPoint) > 0 + ? 0 + : -gapSize; + // DEBUG.push(` -> adjusting delta to: ${delta}`); + } } } } From 47b9fccf23dc63bd61633f66c2727c056dde37f3 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Thu, 29 Jan 2026 17:02:51 -0500 Subject: [PATCH 3/4] 4.5.4 -> 4.5.5 --- CHANGELOG.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e94308085..4f9c16ade 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 4.5.5 + +- [641](https://github.com/bvaughn/react-resizable-panels/pull/641): Removed `aria-orientation` role from root `Group` element as this was invalid according to the ARIA spec; (for more information see the discussion on issue [#640](https://github.com/bvaughn/react-resizable-panels/issues/640)) +- [642](https://github.com/bvaughn/react-resizable-panels/pull/642): **Bugfix**: Fix collapsible `Panel` regression introduced in 4.5.3 + ## 4.5.4 - [638](https://github.com/bvaughn/react-resizable-panels/pull/638): `Panel` avoids unnecessary re-renders in response to mouse-hover state. diff --git a/package.json b/package.json index 329332ec5..c3cfde781 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-resizable-panels", - "version": "4.5.4", + "version": "4.5.5", "type": "module", "author": "Brian Vaughn (https://github.com/bvaughn/)", "contributors": [ From fa50622535140c9d48df590e7263ba948073873d Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Thu, 29 Jan 2026 17:32:14 -0500 Subject: [PATCH 4/4] Add more unit tests --- lib/global/utils/adjustLayoutByDelta.test.ts | 57 ++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/lib/global/utils/adjustLayoutByDelta.test.ts b/lib/global/utils/adjustLayoutByDelta.test.ts index 96b17f2d7..09fd60b23 100644 --- a/lib/global/utils/adjustLayoutByDelta.test.ts +++ b/lib/global/utils/adjustLayoutByDelta.test.ts @@ -2141,5 +2141,62 @@ describe("adjustLayoutByDelta", () => { }); }); }); + + describe("3-panel layouts", () => { + const collapsibleConstraints = { + collapsedSize: 5, + collapsible: true, + minSize: 15 + }; + + test.each([ + [ + "expand left when there are multiple panels", + { + delta: -70, + initialLayout: l([25, 50, 25]), + panelConstraints: c([{}, {}, collapsibleConstraints]), + prevLayout: l([25, 50, 25]), + expectedLayout: l([5, 0, 95]), + pivotIndices: [1, 2] + } + ], + [ + "expand right when there are multiple panels", + { + delta: 70, + initialLayout: l([25, 50, 25]), + panelConstraints: c([collapsibleConstraints, {}, {}]), + prevLayout: l([25, 50, 25]), + expectedLayout: l([95, 0, 5]), + pivotIndices: [0, 1] + } + ] + ])( + "%s", + ( + _, + { + delta, + initialLayout, + panelConstraints, + prevLayout, + pivotIndices, + expectedLayout + } + ) => { + expect( + adjustLayoutByDelta({ + delta, + initialLayout, + panelConstraints, + pivotIndices, + prevLayout, + trigger: "mouse-or-touch" + }) + ).toEqual(expectedLayout); + } + ); + }); }); });