Arrows menu won't close when click is outside (desktop)

Created on 8 October 2023, about 1 year ago
Updated 12 April 2024, 7 months ago

Problem/Motivation

We updated from 2.0.0-alpha3 to 2.0.0-alpha7 and noticed that the menu no longer closes when clicked outside the elements on desktop. We are using the menu with arrows. This issue also exists in 3.0.0, which we'll be updating to soon.

In 2.0.0-alpha3, the handleTouch() function was closing the menu on desktop, and this was changed to target the mobile menu in the more recent versions. Our site allows other modals to be closed when clicked outside the elements, so we want to restore this functionality.

Steps to reproduce

Install 2.0.0-alpha7 or 3.0.0 and create a menu with arrows. Open a dropdown on desktop view and try closing it by clicking outside.

Proposed resolution

We can add a JS function that targets the menu with arrows on desktop and closes the menu when clicked outside. I've created a patch that does this.

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024