Hi everybody,
I see there are quite some views of this post, so maybe some other people have the same problem.
We could solve it (with the help of Mendix support). There has to be done a little workaround.
The main problem is, that the used third party component (plotly) only listens to the resize event of the browser. So we have to fire this event when toggling the menu. As there is no way to add a nanoflow to the toggle menu button, I did the following:
The action looks like this:
// BEGIN EXTRA CODE
function delay(time) {
return new Promise(resolve => setTimeout(resolve, time));
}
// END EXTRA CODE
/**
* @returns {Promise.<void>}
*/
export async function JS_ToggleSidebar() {
// BEGIN USER CODE
var toggleBtns = document.querySelectorAll('.toggle-btn');
toggleBtns.forEach(function(toggleBtn) {
toggleBtn.click();
delay(100).then(() => window.dispatchEvent(new Event("resize")));
});
// END USER CODE
}
Hope this helps anybody.
Best,
Holger