mmistakes / minimal-mistakes

:triangular_ruler: Jekyll theme for building a personal site, blog, project documentation, or portfolio.
https://mmistakes.github.io/minimal-mistakes/
MIT License
12.48k stars 25.73k forks source link

greedy-navigation timeout causes inconsistent behaviour with translucency #4537

Open lifehackerhansol opened 1 year ago

lifehackerhansol commented 1 year ago

What happened?

While below is our site configuration, I have explicitly disabled the portion of the code that causes this issue as a stopgap solution. But this is reproducible even on the documentation site, so I find that a non-issue (and I don't know how the doc site is built, so I can't fill it out for that.)

Expected behavior

Upon timeout of the navigation dropdown, the page should un-fade, and be visible as usual.

Actual behaviour

This behaviour is reproducible on the documentation site as well.

In the event that one opens the navigation bar dropdown menu, let the mouse leave, and wait for the timeout as specified in the greedy navigation JavaScript, the dropdown will disappear as expected, but the background fade will not.

Clicking anywhere else on the page will remove the fade, but the dropdown menu appears again with no fade, and the behaviour persists this way until letting the menu timeout again.

Steps to reproduce the behavior

  1. Have as many items in the navigation.yml to make the greedy-nav dropdown appear
  2. Click on dropdown
  3. Move mouse away from dropdown and wait a few seconds (triggers mouseleave)
    • The issue starts here, where the dropdown disappears, but the background still has translucency, and the dropdown toggle still shows an X
  4. Click anywhere on the screen
    • This will remove the translucency, and the X will turn back into hamburger menu, but then the dropdown menu appears again...?
  5. Click on the dropdown again
    • This adds translucency again, and the hamburger menu changes to an X, but the dropdown menu disappears
  6. Click anywhere on the screen to go back to step 3
  7. Move the mouse into the dropdown menu, then move it back out, to return to a normal state

Other

No response

karmaniverous commented 1 week ago

@lifehackerhansol this PR will resolve the issue once @mmistakes gets around to integrating it.

Meanwhile, see the video & code snippet in the PR for an easy front-end fix that will accomplish the same thing without altering plugin code.