Skip to content

Commit

Permalink
Edge case fix when drag-expanding a collapsed panel that prevents a t…
Browse files Browse the repository at this point in the history
…emporary flicker
  • Loading branch information
bvaughn committed Jan 10, 2023
1 parent 5024008 commit b5d3ec1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/react-resizable-panels/src/utils/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,14 @@ function safeResizePanel(
const nextSizeUnsafe = prevSize + delta;

if (panel.collapsible) {
if (nextSizeUnsafe <= 0) {
return 0;
if (prevSize > 0) {
if (nextSizeUnsafe <= 0) {
return 0;
}
} else {
if (nextSizeUnsafe < panel.minSize) {
return 0;
}
}
}

Expand Down

0 comments on commit b5d3ec1

Please sign in to comment.