mrwweb / clicky-menus

Simple click-triggered navigation submenus. Accessible and progressively enhanced.
MIT License
90 stars 15 forks source link

Feature request: close on scrolling away #10

Closed ajplopez closed 2 years ago

ajplopez commented 2 years ago

Feature Request

It would be really useful if the menu would close itself when the user starts scrolling down. For example, this scenario:

  1. User opens a dropdown
  2. User starts to scroll down the page without closing the menu
  3. The menu closes itself because the user started scrolling away without clicking on anything.
mrwweb commented 2 years ago

Thanks for the feature request @ajplopez. This is an interesting idea. I could imagine wanting this feature in some very specific instances. However I would want to confirm with some very careful user testing that 1) that is actually a problem, and 2) the solution is more helpful than harmful.

I do not plan to implement this. One of the fundamental principles that lead me to click-triggered menus is that they operate explicitly and solely on intentional user interaction. Closing menus as a side-effect of another user interaction goes against that principle.

Luckily, this is a totally open source tool, so I hope you can take this script and modify it however you see fit.