@@ -172,12 +172,25 @@ class GridLayout extends React.Component<GridLayoutProps, GridLayoutState> {
172
172
}
173
173
174
174
componentDidUpdate ( prevProps :GridLayoutProps , prevState :GridLayoutState ) {
175
- const uiLayout = this . getUILayout ( ) ;
176
175
if ( ! draggingUtils . isDragging ( ) ) {
177
176
// log.debug("render. clear ops. layout: ", uiLayout);
178
177
// only change in changeHs, don't change state
179
178
if ( _ . size ( this . state . ops ) > 0 ) {
180
- this . setState ( { layout :uiLayout , changedHs :undefined , ops :undefined } ) ;
179
+ // temporary fix for components becomes invisible in drawer/modal
180
+ // TODO: find a way to call DELETE_ITEM operation after layouts are updated in state
181
+ const ops = [ ...this . state . ops as any [ ] ] ;
182
+ const [ firstOp ] = ops ;
183
+ const { droppingItem} = this . props ;
184
+ if (
185
+ ops . length === 1
186
+ && firstOp . type === 'DELETE_ITEM'
187
+ && firstOp . key === droppingItem ?. i
188
+ ) {
189
+ this . setState ( { changedHs :undefined , ops :undefined } ) ;
190
+ } else {
191
+ const uiLayout = this . getUILayout ( ) ;
192
+ this . setState ( { layout :uiLayout , changedHs :undefined , ops :undefined } )
193
+ }
181
194
}
182
195
}
183
196
if ( ! draggingUtils . isDragging ( ) && _ . isNil ( this . state . ops ) ) {