Menuitems href target does not work as expected

Modules have menuitems href target in their module.xml do not open in new window when it is under drop-down-list style.

for example the tab “User Panel” it’s by default a “button” not “drop-down-list” menu, and as the expected behaviour it open the href in new window.

userpaneltab/module.xml

User Panel

Now if we add a new menuitems for a “new module” to the same category “User Panel” then it will change the menu style from button to drop-down-list including the old “User Panel” tab and the new tab for the new module.

Any link under the drop-down-list will not open in the target window and it will be overridden by js as I can see the html part still have the target and href for the link.

Any suggestions ?

I have found a fix by modifying javascript files

current code

//Links are disabled in menu for now. Final release will remove that
$(’.ui-menu-item’).click(function(){
go = $(this).find(‘a’).attr(‘href’);
if(go && !$(this).find(‘a’).hasClass(‘ui-state-disabled’)) {
document.location.href = go;
}
})

new code

// Modified code
$(’.ui-menu-item’).click(function(event){ // added event
go = $(this).find(‘a’).attr(‘href’);
if(go && !$(this).find(‘a’).hasClass(‘ui-state-disabled’)) {
//document.location.href = go;
event.stopPropagation();
}
})