Skip to content

Commit

Permalink
fix: fix isRequest naming
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Jun 20, 2023
1 parent c1aad6a commit fb90fbd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/react-moveable/src/ables/Draggable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ export default {
const [verticalInfo, horizontalInfo] = checkSnapBoundsDrag(
moveable, distX, distY,
throttleDragRotate,
isRequest || deltaOffset, datas,
isRequest || deltaOffset,
datas,
);
isVerticalSnap = verticalInfo.isSnap;
isVerticalBound = verticalInfo.isBound;
Expand Down
8 changes: 4 additions & 4 deletions packages/react-moveable/src/ables/snappable/snapBounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export function checkSnapBoundsDrag(
distX: number,
distY: number,
throttleDragRotate: number,
isRequest: boolean,
ignoreSnap: boolean,
datas: any
) {
if (!hasGuidelines(moveable, "draggable")) {
Expand Down Expand Up @@ -228,7 +228,7 @@ export function checkSnapBoundsDrag(
const {
vertical: verticalSnapBoundInfo,
horizontal: horizontalSnapBoundInfo,
} = checkMoveableSnapBounds(moveable, isRequest, snapPoses, boundPoses);
} = checkMoveableSnapBounds(moveable, ignoreSnap, snapPoses, boundPoses);
const {
vertical: verticalInnerBoundInfo,
horizontal: horizontalInnerBoundInfo,
Expand Down Expand Up @@ -273,7 +273,7 @@ export function checkSnapBoundsDrag(

export function checkMoveableSnapBounds(
moveable: MoveableManagerInterface<SnappableProps, SnappableState>,
isRequest: boolean,
ignoreSnap: boolean,
poses: { vertical: number[]; horizontal: number[]; },
boundPoses: { vertical: number[]; horizontal: number[]; } = poses,
): DirectionSnapType<Required<SnapBoundInfo>> {
Expand All @@ -288,7 +288,7 @@ export function checkMoveableSnapBounds(
const {
horizontal: horizontalSnapInfo,
vertical: verticalSnapInfo,
} = isRequest ? {
} = ignoreSnap ? {
horizontal: { isSnap: false, index: -1 } as SnapInfo,
vertical: { isSnap: false, index: -1 } as SnapInfo,
} : checkMoveableSnapPoses(
Expand Down

0 comments on commit fb90fbd

Please sign in to comment.