You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the frame grows enough that an li is taken out of the dropdown, the width variable is not updated, causing wrong behaviour. I found the issue by inserting console logs
// Window is growingelse{// We used to just look at the first one, but this doesn't work when the window is maximized//var dropdownFirstItem = dropdown.children('ul.dropdown-menu').children().first();dropdown.children('ul.dropdown-menu').children().each(function(){console.log(width,width+parseInt($(this).attr('data-original-width')),parent_width)if(width+parseInt($(this).attr('data-original-width'));<parent_width){// Restore the topmost dropdown item to the main menuconsole.log("Inserting")dropdown.before(this);}else{// If the topmost item can't be restored, don't look any furtherreturnfalse;}});
The solution is here:
// Window is growingelse{// We used to just look at the first one, but this doesn't work when the window is maximized//var dropdownFirstItem = dropdown.children('ul.dropdown-menu').children().first();dropdown.children('ul.dropdown-menu').children().each(function(){varnewWidth=width+parseInt($(this).attr('data-original-width'));// <---- thisif(newWidth<parent_width){// <---- this// Restore the topmost dropdown item to the main menuwidth=newWidth;// <---- thisdropdown.before(this);}else{// If the topmost item can't be restored, don't look any furtherreturnfalse;}});
The text was updated successfully, but these errors were encountered:
When the frame grows enough that an
li
is taken out of the dropdown, thewidth
variable is not updated, causing wrong behaviour. I found the issue by inserting console logsThe solution is here:
The text was updated successfully, but these errors were encountered: