SwedbankPay/design.swedbankpay.com

Topbar close button interactable when topbar menu is not open

Closed this issue · 1 comments

Describe the bug

The close button is interactable even if topbar menu is closed and in "wide mode".

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://design.swedbankpay.com/v/4.1.0/docs/components/topbar#topbar-wide
  2. Click on the close-button, it cannot be seen unless tabbed to
  3. Click it or press enter while it has focus
  4. See error

Expected behavior

Expected the button to be hidden and not interactable while menu is closed

Actual behavior

Button is interactable and "closes" the menu even if it is not open.

Possible fix

A possible fix would be to add a check if the topbar menu is open on the button's event handler before firing the close event.

Screenshots

gif showing the problem in action

Fixed by #190