Skip to content

Commit 28c94ee

Browse files
committed
check item ref before mounting interact
1 parent c79f85b commit 28c94ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/items/Item.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,13 +427,13 @@ export default class Item extends Component {
427427
const willBeAbleToResizeRight =
428428
this.props.selected && this.canResizeRight(this.props)
429429

430-
if (this.props.selected && !interactMounted) {
430+
if (this.props.selected && !interactMounted && !!this.item) {
431431
this.mountInteract()
432432
interactMounted = true
433433
}
434434

435435
if (
436-
interactMounted &&
436+
interactMounted && !!this.item &&
437437
(couldResizeLeft !== willBeAbleToResizeLeft ||
438438
couldResizeRight !== willBeAbleToResizeRight)
439439
) {
@@ -450,7 +450,7 @@ export default class Item extends Component {
450450
}
451451
})
452452
}
453-
if (interactMounted && couldDrag !== willBeAbleToDrag) {
453+
if (interactMounted && !!this.item && couldDrag !== willBeAbleToDrag) {
454454
interact(this.item).draggable({ enabled: willBeAbleToDrag })
455455
}
456456
}

0 commit comments

Comments
 (0)