Skip to content

Commit

Permalink
fix: fix isDragStart condition #141
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Jul 5, 2023
1 parent 7175900 commit f901416
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/selecto/src/SelectoManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,9 @@ class Selecto extends EventEmitter<SelectoEvents> {
isDragStartEnd: boolean = false,
) {
const { inputEvent, isDouble, data } = e;
const type = inputEvent && inputEvent.type;
const isDragStart = type === "mousedown" || type === "touchstart";

const { added, removed, prevList, list } = diff(
startSelectedTargets,
this.selectedTargets
Expand Down Expand Up @@ -907,8 +910,8 @@ class Selecto extends EventEmitter<SelectoEvents> {
removed: removed.map((index) => prevList[index]),
afterAdded: afterAdded.map((index) => afterList[index]),
afterRemoved: afterRemoved.map((index) => afterPrevList[index]),
isDragStart: isDragStartEnd,
isDragStartEnd,
isDragStart: isDragStart && isDragStartEnd,
isDragStartEnd: isDragStart && isDragStartEnd,
isClick: !!e.isClick,
isDouble: !!isDouble,
rect,
Expand Down

0 comments on commit f901416

Please sign in to comment.