@@ -249,8 +249,8 @@ local register :: (state:State, el:Element, T:Type) -> Element {
249249 return el
250250}
251251
252- local unregisterTree :: (state:State, el:Element) {
253- do {
252+ local unregisterTree :: (state:State, el:Element, updateInteractions:bool ) {
253+ if updateInteractions { -- @Hack!
254254 if state.focusId == el.id state.blurFocus!(abort=false)
255255 if state.activeId == el.id state.cancelMouseActions!()
256256
@@ -269,7 +269,7 @@ local unregisterTree :: (state:State, el:Element) {
269269 remove(state.scrollables, i)
270270 }
271271
272- for el unregisterTree(state, it)
272+ for el unregisterTree(state, it, updateInteractions )
273273}
274274
275275
@@ -3383,22 +3383,22 @@ export hideContextMenu :: (state:State, mayDeactivateSubmenu=false) -> (success:
33833383
33843384
33853385
3386- export delete :: (state:State, el:Element) {
3386+ export delete :: (state:State, el:Element, updateInteractions=true ) {
33873387 updateLayoutIfNeeded(state) -- Needed for parents. @Speed
33883388
33893389 if el.type == Frame {
33903390 local frame = cast(Frame) el
33913391 local found, i = indexOf(state.frames, frame)
33923392 if not found return
33933393
3394- unregisterTree(state, frame)
3394+ unregisterTree(state, frame, updateInteractions )
33953395 remove(state.frames, i)
33963396
33973397 } else {
33983398 local found, i = indexOf(el.parent, el)
33993399 if not found return
34003400
3401- unregisterTree(state, el)
3401+ unregisterTree(state, el, updateInteractions )
34023402 remove(el.parent, i)
34033403 }
34043404}
0 commit comments