I am making API calls through javascript to undock specific panels/tabs.
e.g. layout.undock(‘CAM3’);
It does work and the panel/tab item does get undocked, however I have noticed that in the console I am getting the following error:
Uncaught TypeError: Cannot read properties of undefined (reading ‘selectedTabsWindow’) smart.dockinglayout.js:1176
at BaseElement._setFloatingItemsHeaderButtons (smart.dockinglayout.js:1176:23)
at BaseElement.undock (smart.dockinglayout.js:313:274)
at BaseElement.o (smart.dockinglayout.js:2827:53)
at cam2_show (index.js:162:12)
I tried the same dock/undock function in your online demos at: “https://www.htmlelements.com/demos/docking-layout/item-dock-undock/” and this basically gives the same error as shown below:
Uncaught TypeError: Cannot read properties of undefined (reading ‘selectedTabsWindow’) smart.dockinglayout.js:20
at BaseElement._setFloatingItemsHeaderButtons (smart.dockinglayout.js:20:83709)
at BaseElement.undock (smart.dockinglayout.js:20:7471)
at BaseElement.r (smart.dockinglayout.js:27:72203)
at BaseElement.<anonymous> (index.js:57:28)
Thus I am assuming it is not a coding error my side. Can you please advise how to resolve this as I cannot run other javascript code that is following the “undock” call.