Mega menus sf-multicolumn width set to '0px' on window resizing

Created on 2 December 2021, over 3 years ago
Updated 28 April 2025, 5 days ago

Problem/Motivation

When user load a page in a small window on desktop, and resize it to fullscreen, mega menu columns width are not updated and are still set to 0px.

Steps to reproduce

Drupal 8/9
Superfish module installed with Composer
Supersubs enabled

Proposed resolution

Here is the patch that I've set up, but it's just a patch...

/**
* Fix : force Superfish main megamenus columns widths
*/
$(document).once('forceMainMenuColumnWidths', context).each(function () {
  $('#superfish-main li.sf-depth-1').mouseover(function () {
    const nb_columns = $(this).find('.sf-multicolumn-wrapper ol li.sf-multicolumn-column').length;
    $(this).find('.sf-multicolumn').css({'min-width': nb_columns * 208 + 'px'});
  });
});

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Postponed: needs info

Version

1.4

Component

Code

Created by

🇫🇷France Attraktive

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇧🇪Belgium lobsterr

    Tried to reproduce it on the different themes with settings without any success. Could you provide more context maybe ?
    Drupal version, theme?

Production build 0.71.5 2024