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 {
11921192
11931193 // check for content changing
11941194 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 ) ) ;
11981200 }
1201+ const tempEl = document . createElement ( "div" ) ;
1202+ tempEl . innerHTML = w . content ;
1203+ tempEl . childNodes . forEach ( childNode => itemContent . insertBefore ( childNode , subGrid ) ) ;
1204+
11991205 delete w . content ;
12001206 }
12011207
You can’t perform that action at this time.
0 commit comments