Skip to content

Commit

Permalink
Merge pull request #169 from jennysong/master
Browse files Browse the repository at this point in the history
fixes edge case: dragging event
  • Loading branch information
StephenChou1017 authored Dec 5, 2019
2 parents 08befd8 + 6dfce26 commit 7679695
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/DnDContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ export default class DnDContext {
}
const point = monitor.getClientOffset();
let leftIndex = Math.floor((point.x - pos.x)/cellWidth);
if(!resourceEvents.headerItems[leftIndex]) {
return;
}
let newStart = resourceEvents.headerItems[leftIndex].start;
let newEnd = resourceEvents.headerItems[leftIndex].end;
if(cellUnit !== CellUnits.Hour)
Expand Down Expand Up @@ -125,4 +128,4 @@ export default class DnDContext {
getDndSource = (dndType = DnDTypes.EVENT) => {
return this.sourceMap.get(dndType);
}
}
}

0 comments on commit 7679695

Please sign in to comment.