Closed synthetiv closed 2 months ago
@synthetiv Thanks for the issue and PR!
I see the issue in the code pen, good catch. I'll boot up the local demo environment with your fix to test it shortly.
We should add a couple tests for this as well.
v4.1.0 is out and includes this. Closing.
Summary
With a DisclosureMenu with hover on and leaveDelay > 0, if you hover to open a menu, move your mouse cursor outside the menu, and then return the cursor before menu closes, the menu will still close, even with your cursor hovering over it. This behavior is awkward and confusing for users.
Steps to reproduce
Expected Behaviour
leaveDelay timeout should be cleared on cursor re-entry. Menus should only close when you (a) open another menu, or (b) keep your cursor outside them for leaveDelay ms.
Additional context
CodePen example, based on the "Disclosure Navigation Menu" example from this repo: https://codepen.io/synthetiv/pen/WNWGqxr