Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(cdkTargetMenuAim): directive does not really work #28986

Open
Beilinson opened this issue May 1, 2024 · 0 comments
Open

bug(cdkTargetMenuAim): directive does not really work #28986

Beilinson opened this issue May 1, 2024 · 0 comments
Labels
area: cdk/menu P4 A relatively minor issue that is not relevant to core functions

Comments

@Beilinson
Copy link

Beilinson commented May 1, 2024

Description

According to the docs, the cdkTargetMenuAim allows for a "Smart Aim" behavior which calculates the intended slope of the mouse pointer and does not switch to another submenu unless some timeout is reached or the mouse deviates from the slope. This behavior does not seem to work at all (tested on several versions: 16.1.2, 17.3.6).

Reproduction

StackBlitz link: https://stackblitz.com/edit/qwy1he?file=src%2Fexample%2Fcdk-menu-menubar-example.html
Steps to reproduce:

  1. Try moving in a diagonal line from the edit menu item to the cut menu item in the submenu.
  2. Doing so will immediately open the share submenu instead, no matter how fast the action is done (unless its faster than the refresh rate of the monitor)

Expected Behavior

That moving the mouse along a diagonal line only opens a different subMenu if the mouse took too long to travel.
see https://rawgit.com/kamens/jQuery-menu-aim/master/example/example.html for an example

Actual Behavior

The different submenus disappear immediately.

From my limited debugging I was able to glean that the issue seems to stem from the PointerTracker, where the _getItemPointerEntries() stream doesn't seem to get output any value on entering children menu items, while the exit is called every time, meaning the previousElement and activeElement are set as undefined for the duration of the mouse interaction with the menu items and submenus.

Environment

  • Angular: 17.3.6
  • CDK: 17.3.6
  • Browser(s): Chrome, Firefox
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows
@Beilinson Beilinson added the needs triage This issue needs to be triaged by the team label May 1, 2024
@amysorto amysorto added P4 A relatively minor issue that is not relevant to core functions area: cdk/menu and removed needs triage This issue needs to be triaged by the team labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cdk/menu P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

No branches or pull requests

2 participants