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(CDK menu): Menu directive breaks scrollbar scrolling behavior #30130

Open
2 of 5 tasks
ptu14 opened this issue Dec 5, 2024 · 0 comments
Open
2 of 5 tasks

bug(CDK menu): Menu directive breaks scrollbar scrolling behavior #30130

ptu14 opened this issue Dec 5, 2024 · 0 comments
Labels
needs triage This issue needs to be triaged by the team

Comments

@ptu14
Copy link

ptu14 commented Dec 5, 2024

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When the @angular/cdk/menu directive is applied to a scrollable element, it causes scroll behavior abnormalities. Clicking in the empty space within the scrollable area causes the content to unexpectedly scroll to the top. Additionally, general mouse scrolling behavior becomes erratic and unpredictable.

Reproduction

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

  • 1. Create a scrollable container with some content that exceeds the container height
  • 2. Apply the @angular/cdk/menu directive to this container
  • 3. Try to scroll using the mouse:
  • 4. Click in the empty space within the scrollable area

video:
https://github.com/user-attachments/assets/1604a8f4-06b6-4bbf-809d-de0ecb2bb2f6

Expected Behavior

Clicking in empty space of the scrollbar should behave like natively, i.e. actually scroll down

Actual Behavior

Clicking in empty space within the scrollable area causes the content to immediately scroll to the top

Environment

  • Angular: 19.0.2
  • CDK/Material: 19.0.2
  • Browser(s): Chrome Version 131.0.6778.85 (Official Build) (arm64), Safari Version 18.1 (18619.2.8.111.5, 18619), Probably all browsers
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS, probably all systems
@ptu14 ptu14 added the needs triage This issue needs to be triaged by the team label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue needs to be triaged by the team
Projects
None yet
Development

No branches or pull requests

1 participant