-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Labels
Description
Subject of the issue
When I update a widget with a nested grid using update(els: GridStackElement, opt: GridStackWidget), and provide content in the opt parameter, the nested grid is also removed (even though the subGridOpts field is not present in the opt parameter).
Your environment
- version of gridstack.js: tried on 8.3.0-dev, 8.3.0, 8.2.3, 7.3.0
- which browser/OS: Firefox / Chrome, Linux / Windows
Steps to reproduce
- Create a nested grid
- Call update() on it with an
optparameter like this:{content: '<div>some content</div>'} - JSFiddle: https://jsfiddle.net/1yr8ngju/
Expected behavior
The nested grid should not be removed, only the content that has been set originally when creating the widget.

I created a fork with a quick "fix": master...akosfekete:gridstack.js:sub-grid-update-issue
I'm not sure if this is intended in some way, but since the documentation says that "Only those set will be updated", I'd epect the nested grid to remain.
