Hey Jose,
you need Html snippet widget -https://docs.mendix.com/appstore/widgets/html-javascript-snippet/, and you need to create button to close pop-up and hide that button from screen and add it following class buttonClosePage. Also inside Html snippet you need to add following JavaScript code.
var divs = document.querySelectorAll('div.mx-underlay');
divs.forEach(function(currentDiv) {
currentDiv.addEventListener('click', function() {
var closeButton = document.querySelector('div.buttonClosePage');
if (closeButton) {
closeButton.click();
}
});
});
Best regards, Slavko
Ok, so based on your comment, I ended up adding a HTML snippet, with the following JQuery:
$(document).on('mouseleave', '.popupmenu-menu', function(){
$('.popupmenu-menu').hide();
});
$(document).on('mouseenter', '.popupmenu-trigger', function(){
$('.popupmenu-menu').show();
});
This seems to work just fine. :)