-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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(MatTooltip): Can't scroll if target element has matTooltip #30069
Comments
Some additional info I gathered in the past hour: I don't know why this works since the initial value of In my Stackblitz repo I also tried playing around with the |
It's because the tooltip uses a long press gesture on touch devices which can interfere with scrolling. You can use the |
Thank you for your time and for providing clarity on this @crisbeto! I appreciate the quick response. Could you elaborate on why scrolling and opening the tooltip can't work together by default? With the workaround I implemented ( I’ve experimented with the This limitation is currently preventing me from effectively using mat-tooltip in mat-table cells, as it blocks users from scrolling through the table on mobile devices. |
Is this a regression?
The previous version in which this bug was not present was
According to Issue 4892, this bug should've been fixed in Angular 11+
Description
Scrolling on a touch device doesn't work if the target of the gesture is an element using matTooltip.
This is apparently a regression as people mentioned it being fixed in angular 11+:
#4892
Tagging @wagnermaciel @crisbeto and @jelbourn as they commented on the previous issue.
Reproduction
StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-nnqsnt?file=src%2Fmain.html
Steps to reproduce:
I also included a CSS workaround which appears to be working but shouldn't be necessary.
Expected Behavior
Scrolling behavior should not be affected by the presence or absence of a mat tooltip.
Actual Behavior
Scrolling behavior is disabled by targeting a mat tooltip element.
Environment
Node: 18.20.3
Package Manager: npm 10.2.3
OS: linux x64
Angular: 19.0.0
... animations, build, cli, common, compiler, compiler-cli, core
... forms, material, platform-browser, router
Package Version
@angular-devkit/architect 0.1900.0
@angular-devkit/core 19.0.0
@angular-devkit/schematics 19.0.0
@schematics/angular 19.0.0
rxjs 7.8.1
typescript 5.6.3
zone.js 0.15.0
CDK/Material: "@angular/material": "^19"
Browser(s): Firefox
Operating System (e.g. Windows, macOS, Ubuntu): Android
The text was updated successfully, but these errors were encountered: