File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ Change log
5
5
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
6
6
** Table of Contents** * generated with [ DocToc] ( http://doctoc.herokuapp.com/ ) *
7
7
8
+ - [ 5.1.0-dev (TBD)] ( #510-dev-tbd )
8
9
- [ 5.1.0 (2022-05-21)] ( #510-2022-05-21 )
9
10
- [ 5.0.0 (2022-01-10)] ( #500-2022-01-10 )
10
11
- [ 4.4.1 (2021-12-24)] ( #441-2021-12-24 )
@@ -67,6 +68,8 @@ Change log
67
68
68
69
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
69
70
71
+ ## 5.1.0-dev (TBD)
72
+ * fix v5.1.0 regression [ #1973 ] ( https://github.com/gridstack/gridstack.js/issues/1973 ) DnD Snap to Animation
70
73
71
74
## 5.1.0 (2022-05-21)
72
75
* add ` GridStack.registerEngine() ` to let user use their own custom layout engine subclass. Thank you [ Thomas] for sponsoring it.
Original file line number Diff line number Diff line change @@ -236,11 +236,11 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
236
236
// don't bother restoring styles if we're gonna remove anyway...
237
237
if ( this . dragElementOriginStyle && ( ! node || ! node . _isAboutToRemove ) ) {
238
238
let helper = this . helper ;
239
- DDDraggable . originStyleProp . forEach ( prop => helper . style [ prop ] = this . dragElementOriginStyle [ prop ] || null ) ;
240
- // show up instantly otherwise we animate to off the grid when switching back to 'absolute' from 'fixed'
241
- helper . style . transition = 'none' ;
239
+ // don't animate, otherwise we animate offseted when switching back to 'absolute' from 'fixed'
242
240
let transition = this . dragElementOriginStyle [ 'transition' ] || null ;
243
- setTimeout ( ( ) => helper . style . transition = transition , 0 ) ; // recover animation from saved vars
241
+ helper . style . transition = this . dragElementOriginStyle [ 'transition' ] = 'none' ;
242
+ DDDraggable . originStyleProp . forEach ( prop => helper . style [ prop ] = this . dragElementOriginStyle [ prop ] || null ) ;
243
+ setTimeout ( ( ) => helper . style . transition = transition , 50 ) ; // recover animation from saved vars after a pause (0 isn't enough #1973)
244
244
}
245
245
delete this . dragElementOriginStyle ;
246
246
return this ;
You can’t perform that action at this time.
0 commit comments