- Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(material/tabs): remove delay on touch devices #31489
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
base: main
Are you sure you want to change the base?
Conversation
Fixes that the tabs had a small delay on touch devices. Fixes angular#31488.
Quick note for testing: I made exactly the same modification in our code last week. (as an override in another SCSS class)
On these devices |
Deployed dev-app for ea45c96 to: https://ng-dev-previews-comp--pr-angular-components-31489-dev-nuk8yb8g.web.app Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt. |
That sounds like there may be something more going on that is slowing the page down (e.g. heavy component being rendered out inside the tabs). I can actually only reproduce the delay on the Chrome device emulation, but not on an iPhone 13 with iOS 18.5, neither in the docs site or our local development app. It's also worth noting that Webkit removed the delay by default almost 10 years ago. Do you notice any delay in these two demos?
|
Tested on real hardware, recorded evidence. The issue is still there, see below.
That was my first thought, but it's not the case, happens on empty mat-tabs as well and in your official samples.
I saw that history when trying to debug this. Something about mat-tabs is cursed, in a way that it triggers that 300ms delay anyway on iOS / iPadOS Safari / Edge, see the following evidence. I recorded this on an iPad 9th gen, iPad OS 18.5, on Safari. I tested both branches the links you provided. I used the "No Animation" variants, to prevent animation messing with our results. I'm interested in the time from touch to the tab becoming visible / turning blue. Timeline.1.mp4Here I made it frame by frame.
Chrome's device emulation does the same and there it is fixed by I am not holding my finger on the tab, it's an instant tap and release. Safari enforces this delay. In fact, the tab sliding animation doesn't even start until 300ms later, until the delay is over. This is the main reason for sluggish lag feeling. This doesn't happen on Andoird, neither on Firefox mobile, nor Chrome Android, in neither branches. But on iPad OS Safari, iOS Safari it does. |
Do you see the same in this example that sets |
Yes, that is the exact example that I tested in the above recording. |
Fixes that the tabs had a small delay on touch devices.
Fixes #31488.