[6.0] Fix default menu layout - submenu stay open on page load #46436
+23
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request for Issue #46364 .
Replacement for #46397 (same code that is tested, but moved to previous branch)
Summary of Changes
Introduce a new class (nav-active-open) for the default menu, allowing control over whether submenus are opened automatically on page load for the active menu item.
Caution
This functionality should not be activated by default without an additional class for all default menus, as it may not be desirable in various other module positions.

Example - Cassiopeia menu position
Additionally updated the
toggleSubMenumethod to use optional chaining when setting thearia-expandedattribute, preventing errors if the target element is missing.Testing Instructions
sidebar-rightDefaultStep 1
Help -> WorkflowsStep 2
nav-active-openHelp -> WorkflowsImportant
For this to test an update of the media asset is required, please use the prebuilt packages or run npm install.
menu-fix.mp4
Actual result BEFORE applying this Pull Request
Should always be collapsed - with and without the class.
Expected result AFTER applying this Pull Request
Step 1
Submenu with menu entry
Workflowsshould be always collapsed (without the class).Step 2
Submenu with menu entry
Workflowsshould stay open on new page load ifWorkflowis the current active item (with class set).Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed