Adding selected attribute to option element with active link class doesn't work

Created on 5 December 2016, over 8 years ago
Updated 15 June 2023, almost 2 years ago

When using Superfish to display a select list via the sf-Smallscreen settings, there is a feature which adds the "selected" attribute to the option element with the class active. As the help text says, the feature pre-selects the item linked to the active page when the page loads. So, in the select list you should see the link title of the active page (instead of the first item in the select element or a custom select title).

The feature used to work in the D7 version of Superfish, but doesn't in the D8 version. The reason is that the changed name of the active hyperlink class hasn't been reflected in the relevant JavaScript.

Steps to reproduce:

  • Install Superfish including the library.
  • Place a Superfish menu on the Manage blocks page, and configure the block:
  • In the sf-Smallscreen section:
    • choose "Enable jQuery sf-Smallscreen plugin for this menu."
    • Enable "Convert the menu to a select element."
    • Provide a select title, e.g. "Menu".
    • Select settings: Enable "Add selected attribute to the element with the class active."
    • More: Enable "Copy the hyperlink classes to the option elements of the select."
  • Visit a page with the menu. To see the menu as a select list, respect the Window width settings in the Block configuration.

As a result, you don't see the link title of the active page at the top of the menu but the custom select title, regardless of the visited page.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany Olafski Hamburg

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.

Production build 0.71.5 2024