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
55<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
66** Table of Contents** * generated with [ DocToc] ( http://doctoc.herokuapp.com/ ) *
77
8+ - [ 5.1.0-dev (TBD)] ( #510-dev-tbd )
89- [ 5.1.0 (2022-05-21)] ( #510-2022-05-21 )
910- [ 5.0.0 (2022-01-10)] ( #500-2022-01-10 )
1011- [ 4.4.1 (2021-12-24)] ( #441-2021-12-24 )
@@ -67,6 +68,8 @@ Change log
6768
6869<!-- END doctoc generated TOC please keep comment here to allow auto update -->
6970
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
7073
7174## 5.1.0 (2022-05-21)
7275* 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
236236 // don't bother restoring styles if we're gonna remove anyway...
237237 if ( this . dragElementOriginStyle && ( ! node || ! node . _isAboutToRemove ) ) {
238238 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'
242240 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)
244244 }
245245 delete this . dragElementOriginStyle ;
246246 return this ;
You can’t perform that action at this time.
0 commit comments