File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -1192,10 +1192,16 @@ export class GridStack {
1192
1192
1193
1193
// check for content changing
1194
1194
if ( w . content ) {
1195
- let sub = el . querySelector ( '.grid-stack-item-content' ) ;
1196
- if ( sub && sub . innerHTML !== w . content ) {
1197
- sub . innerHTML = w . content ;
1195
+ let toRemove = el . querySelectorAll ( '.grid-stack-item-content > :not(.grid-stack-nested, style)' ) ;
1196
+ const subGrid = el . querySelector ( '.grid-stack-item-content > .grid-stack-nested' )
1197
+ const itemContent = el . querySelector ( '.grid-stack-item-content' ) ;
1198
+ if ( toRemove ) {
1199
+ toRemove . forEach ( child => itemContent . removeChild ( child ) ) ;
1198
1200
}
1201
+ const tempEl = document . createElement ( "div" ) ;
1202
+ tempEl . innerHTML = w . content ;
1203
+ tempEl . childNodes . forEach ( childNode => itemContent . insertBefore ( childNode , subGrid ) ) ;
1204
+
1199
1205
delete w . content ;
1200
1206
}
1201
1207
You can’t perform that action at this time.
0 commit comments