@@ -211,16 +211,20 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
211211 /** @internal */
212212 private _setupHelperStyle ( ) : DDDraggable {
213213 // TODO: set all at once with style.cssText += ... ? https://stackoverflow.com/questions/3968593
214- this . helper . style . pointerEvents = 'none' ;
215- this . helper . style . width = this . dragOffset . width + 'px' ;
216- this . helper . style . height = this . dragOffset . height + 'px' ;
217- this . helper . style . willChange = 'left, top' ;
218- this . helper . style . transition = 'none' ; // show up instantly
219- this . helper . style . position = 'fixed' ; // let us drag between grids by not clipping as parent .grid-stack is position: 'relative'
220- this . helper . style [ 'min-width' ] = 0 ; // since we no longer relative to our parent and we don't resize anyway (normally 100/#column %)
214+ const rec = this . helper . getBoundingClientRect ( ) ;
215+ const style = this . helper . style ;
216+ style . pointerEvents = 'none' ;
217+ style [ 'min-width' ] = 0 ; // since we no longer relative to our parent and we don't resize anyway (normally 100/#column %)
218+ style . width = this . dragOffset . width + 'px' ;
219+ style . height = this . dragOffset . height + 'px' ;
220+ style . willChange = 'left, top' ;
221+ style . position = 'fixed' ; // let us drag between grids by not clipping as parent .grid-stack is position: 'relative'
222+ style . left = rec . left + 'px' ;
223+ style . top = rec . top + 'px' ;
224+ style . transition = 'none' ; // show up instantly
221225 setTimeout ( ( ) => {
222226 if ( this . helper ) {
223- this . helper . style . transition = null ; // recover animation
227+ style . transition = null ; // recover animation
224228 }
225229 } , 0 ) ;
226230 return this ;
0 commit comments