ui: sync expanded state for selected submenus

Noticed while reviewing https://github.com/opnsense/core/pull/10942

This will prevent two submenus being open at the same time regardless
of depth, which seemed to happen particularly on second-level submenus.

This will cause more shifting around, but this consistency is already
applied on the first-level submenu.

The alternative is to allow multiple second-level submenus open
at the same time and only close when switching top-level sections.
This commit is contained in:
Stephan de Wit
2026-10-09 15:29:05 +02:00
parent 2c04169a64
commit e113cd729c
@@ -13,7 +13,8 @@
{% if subMenuItem.Url == '' %}
{# next level items, submenu is a container #}
<a href="#{{ topMenuItem.Id }}_{{ subMenuItem.Id }}" class="{{ subMenuItem.LinkClass }}"
data-toggle="collapse" data-parent="#{{ topMenuItem.Id }}">
data-toggle="collapse" data-parent="#{{ topMenuItem.Id }}"
aria-expanded="{% if subMenuItem.Selected %}true{% else %}false{% endif %}">
<div style="display: table;width: 100%;">
<div style="display: table-row">
<div style="display: table-cell">{{ subMenuItem.VisibleName }}</div>