File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -958,6 +958,17 @@ export class GridStackEngine {
958
958
return this . _layouts ?. [ column ] ?. findIndex ( l => l . _id === n . _id ) ?? - 1 ;
959
959
}
960
960
961
+ public removeNodeFromLayoutCache ( n : GridStackNode ) {
962
+ if ( ! this . _layouts ) {
963
+ return ;
964
+ }
965
+ for ( let i = 0 ; i < this . _layouts . length ; i ++ ) {
966
+ let index = this . findCacheLayout ( n , i ) ;
967
+ if ( index !== - 1 ) {
968
+ this . _layouts [ i ] . splice ( index , 1 ) ;
969
+ }
970
+ }
971
+ }
961
972
962
973
/** called to remove all internal values but the _id */
963
974
public cleanupNode ( node : GridStackNode ) : GridStackEngine {
Original file line number Diff line number Diff line change @@ -2141,6 +2141,7 @@ export class GridStack {
2141
2141
this . _updateContainerHeight ( ) ;
2142
2142
this . engine . addedNodes . push ( node ) ; // @ts -ignore
2143
2143
this . _triggerAddEvent ( ) ; // @ts -ignore
2144
+ this . engine . removeNodeFromLayoutCache ( node ) ;
2144
2145
this . _triggerChangeEvent ( ) ;
2145
2146
2146
2147
this . engine . endUpdate ( ) ;
You can’t perform that action at this time.
0 commit comments