I find myself doing this a lot: I move my mouse to the navigation item that I want, and then click on it.

The drawer then appears and disappears because the hover event causes it to appear, and then the click event causes it to disappear.

Proposed resolution

Insert a small timeout (250-500ms?) on the click event if the menu item is already in an open state.

Issue fork drupal-3461284

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mherchel created an issue. See original summary.

mherchel changed the visibility of the branch 3461284-prevent-simultaneous-openclose to hidden.

mherchel changed the visibility of the branch 3461284-prevent-simultaneous-openclose to active.

mherchel’s picture

Status: Active » Needs review

MR ready for review. Playing around with it, I ended up at 500ms.

quietone’s picture

Version: 11.0.x-dev » 11.x-dev
finnsky’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for working on this annoying problem.
I looked and confirm that everything works well.

In the future I would remove the timeouts and replace them with animation times. But for now we can move on like this.

nod_’s picture

Status: Reviewed & tested by the community » Needs work

Nice fix, some comments on the MR.

mherchel’s picture

Status: Needs work » Needs review

Fixed!

  • Data attribute prefixed with drupal
  • When I set the attribute, I set the value to 'true'. Setting it to an empty string didn't feel right when I was checking the value of it. I'd have to either 1) check for the empty string 2) check if not undefined 3) use triple bangs (!!!)... all of which seemed kinda weird for me. Either way, I think it's good now!
finnsky’s picture

Status: Needs review » Reviewed & tested by the community

Still good!

  • nod_ committed eacdda96 on 10.3.x
    Issue #3461284 by mherchel, finnsky, quietone, nod_: Prevent...

  • nod_ committed 1dcc53dd on 10.4.x
    Issue #3461284 by mherchel, finnsky, quietone, nod_: Prevent...

  • nod_ committed 9c482363 on 11.0.x
    Issue #3461284 by mherchel, finnsky, quietone, nod_: Prevent...

  • nod_ committed c1708b32 on 11.x
    Issue #3461284 by mherchel, finnsky, quietone, nod_: Prevent...
nod_’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed c1708b3265 to 11.x and 9c482363bb to 11.0.x and 1dcc53dd09 to 10.4.x and eacdda9692 to 10.3.x. Thanks!

mherchel’s picture

🙌 🙌

Yay! Thanks @finnsky and @nod_

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.