SwedbankPay/design.swedbankpay.com

Sidebar items without submenu are crashing

stinehso opened this issue · 0 comments

Describe the bug
Sidebar component is crashing on the code line element.parentElement.querySelector("[aria-expanded=true]").setAttribute("aria-expanded", "false"); when selecting an item/ leaf without their own submenu, and then selecting another item on the same level.

Routing still works fine, but the menu item is not marked as selected, and you also have to click twice to open a submenu because of this.

To Reproduce
Steps to reproduce the behavior:

  1. Go to demo in dg docs
  2. 'Home page' is selected by default
  3. Click on 'Get started'
  4. See error in console
  5. Click again on 'Get started' and the menu will open

Expected behavior

Expected any menu item to show up as selected and open menu after one click

Actual behavior

It looks like no menu item is selected, and you have to click twice to see selection

Screenshots

image
image