Skip to content

Commit

Permalink
web: fix snapping logic
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodrr committed Dec 30, 2024
1 parent 263c970 commit d72b502
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/web/src/components/split-pane/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,10 @@ export const SplitPane = React.forwardRef<
);

// snapping logic
if (currentPaneLimits.snap > 0 && distanceX <= 0) {
if (nextSizes[i] <= currentPaneLimits.snap / 2)
if (currentPaneLimits.snap > 0) {
if (distanceX < 0 && nextSizes[i] <= currentPaneLimits.snap / 2) {
nextSizes[i] = currentPaneLimits.min;
else if (nextSizes[i] < currentPaneLimits.snap) {
} else if (nextSizes[i] < currentPaneLimits.snap) {
// reset axis
axis.current[splitAxis] += -distanceX;
return;
Expand Down

0 comments on commit d72b502

Please sign in to comment.