|
1 | 1 | import PropTypes from 'prop-types' |
2 | 2 | import React from 'react' |
3 | 3 | import EventRow from '../../EventRow' |
4 | | -import Selection, { |
5 | | - getBoundsForNode, |
6 | | - getEventNodeFromPoint, |
7 | | -} from '../../Selection' |
| 4 | +import Selection, { getBoundsForNode } from '../../Selection' |
8 | 5 | import * as dates from '../../utils/dates' |
9 | 6 | import { eventSegments } from '../../utils/eventLevels' |
10 | 7 | import { getSlotAtX, pointInBox } from '../../utils/selection' |
@@ -162,17 +159,17 @@ class WeekWrapper extends React.Component { |
162 | 159 | selector.on('beforeSelect', point => { |
163 | 160 | const { isAllDay } = this.props |
164 | 161 | const { action } = this.context.draggable.dragAndDropAction |
165 | | - const eventNode = getEventNodeFromPoint(node, point) |
| 162 | + const bounds = getBoundsForNode(node) |
166 | 163 |
|
167 | 164 | // eventOffsetLeft is distance from the left of the event to the initial |
168 | 165 | // mouseDown position. We need this later to compute the new top of the |
169 | 166 | // event during move operations, since the final location is really a |
170 | 167 | // delta from this point. note: if we want to DRY this with |
171 | 168 | // EventContainerWrapper, probably better just to capture the mouseDown |
172 | 169 | // point here and do the placement computation in handleMove()... |
173 | | - this.eventOffsetLeft = point.x - getBoundsForNode(eventNode).left |
| 170 | + this.eventOffsetLeft = point.x - bounds.left |
174 | 171 |
|
175 | | - const isInBox = pointInBox(getBoundsForNode(node), point) |
| 172 | + const isInBox = pointInBox(bounds, point) |
176 | 173 | return ( |
177 | 174 | action === 'move' || (action === 'resize' && (!isAllDay || isInBox)) |
178 | 175 | ) |
|
0 commit comments