1+ import { scrollParent , scrollTop } from 'dom-helpers'
2+ import qsa from 'dom-helpers/cjs/querySelectorAll'
13import PropTypes from 'prop-types'
24import React from 'react'
35import { DnDContext } from './DnDContext'
4- import { scrollParent , scrollTop } from 'dom-helpers'
5- import qsa from 'dom-helpers/cjs/querySelectorAll'
66
77import Selection , {
88 getBoundsForNode ,
@@ -110,24 +110,6 @@ class EventContainerWrapper extends React.Component {
110110 this . update ( event , newRange )
111111 }
112112
113- _cleanupPreviewElements = ( ) => {
114- if ( this . ref . current ) {
115- const previewElements = qsa (
116- this . ref . current ,
117- '.rbc-addons-dnd-drag-preview'
118- )
119- previewElements . forEach ( ( el ) => {
120- if ( el . parentNode ) {
121- try {
122- el . parentNode . removeChild ( el )
123- } catch ( err ) {
124- // Ignore removal errors
125- }
126- }
127- } )
128- }
129- }
130-
131113 handleDropFromOutside = ( point , boundaryBox ) => {
132114 const { slotMetrics, resource } = this . props
133115
@@ -145,9 +127,8 @@ class EventContainerWrapper extends React.Component {
145127 resource,
146128 } )
147129
130+ // Cleanup after dropping from outside
148131 this . reset ( )
149- // Only call cleanup here, after dropping from outside
150- this . _cleanupPreviewElements ( )
151132 }
152133
153134 handleDragOverFromOutside = ( point , bounds ) => {
0 commit comments