You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
destroy(false) requires staticGrid: false to reinitialize resize/drag properly #1764
When destroying a grid using grid.destroy(false) you must specify the staticGrid option during reinitialization. Calling destroy(false) should not overwrite the grid's options and use the defaults as depicted in the documentation.
Your environment
gridstack.js v4.2.3, HTML5
Chrome, Windows 10
Steps to reproduce
Initialize grid using default constructor (or anything really)
Destroy the grid using grid.destroy(false)
Reinitialize the grid using the default constructor (which assumes staticGrid: false)
Drag/Resize will no longer work
Execute grid.setStatic(false), drag/resize works again
I was able to reproduce this using the 'demo1' example as well.
Calling destroy(false) then init() should keep the default options/functionality. In this case, staticGrid should be set to false. This will continue to allow grid items to be resizable and draggable.
Actual behavior
After destroying a grid and reinitializing with the default constructor, the grid becomes static and prevents drag/resize actions on the grid items requiring either an API call to grid.setStatic(false) or adding a redundant staticGrid: false to the initializer options.
Happy to supply more info!
P.S. This was supposedly resolved in this PR: #1209
Activity
adumesny commentedon May 25, 2021
thank you. it's busted in JQ as well even though 1209 did solve it back then (when there wasn't an h5 version).
periapsistech commentedon May 25, 2021
@adumesny Well that would explain it! :)
destroy(false) doesn't force static grid
adumesny commentedon May 29, 2021
fixed in next release. if you find this lib useful, don't forget to donate!