Dhx.window.destructor error if text controlls in form

https://snippet.dhtmlx.com/6gpnwrbl

I’m running a script to destruct a window containing a form.
If the form has any input/textarea type controlls, script error occurs.
pls confirm. thx

Hello, I noticed that if you use the awaitRedraw function the error does not occur.

function destroy() {
    dhxwindow.hide();
    dhx.awaitRedraw().then(() => {
        dhxwindow.destructor();
    })
}

However, I have this problem using DHTMLX Optimus, up to version 8.3.7 it works normally, after that an exception occurs. I have a window, and I switch between the views (with layout and form attached), through events, and when call the destroy() method of the view to be removed, the following error occurs:

@sematik could you do some tests trying to simulate the error please? At the moment I didn’t have time to make a demo available, but if I can’t simulate it I can take some time to do it.

Thank you very much in advance

In the same way I managed to “solve” the problem by first removing the old view, and using awaitRedraw to attach the new view.

However, these exceptions should not occur, I think.

this.layout.getCell("containerEditLayoutSistema").detach();
dhx.awaitRedraw().then(() => {
   this.show(this.layout.getCell("containerEditLayout"), selectedTab, {...});
});

Olá, @sematik percebi que foi corrigido o problema com destructor de forma automática. Porém se eu chamar layout.destructor() explicitamente é lançado uma exceção. Segue o exemplo anterior de forma atualizada dentro da função destroy():

https://snippet.dhtmlx.com/3mqvvyie

Edit: in this case I have a layout attached to the window, and the form is attached to the layout.