Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Flickering on iOS when scrolling a screen with multiple tooltips / button ink effects #1879

Closed
srdone opened this issue Mar 12, 2015 · 8 comments
Labels
Milestone

Comments

@srdone
Copy link

srdone commented Mar 12, 2015

I'm working on an app that uses multiple instances of md-tooltip and md-button inside md-cards in a ui-view (using ui-router). When I scroll on my iPhone 5, I get an annoying flicker.

It only seems to happen whenever my finger hits one of the elements with animation (like the tool-tip or the button). If I avoid hitting them, I don't get any flickering. Is there a way to stop those animations from happening while the screen is scrolling so I can avoid this issue?

@srdone
Copy link
Author

srdone commented Mar 12, 2015

Here's a github repo as an example. https://github.com/srdone/angular-material-flickering-ios

@tam3r
Copy link

tam3r commented Mar 12, 2015

+1. Ripple animation on a touched element occurs even when scrolling. An easy fix is to detect scrolling and prevent ripple animation from happening in that case.

@emmagamma
Copy link

I've been experiencing the same problem as well.

Looks like it's because of this line:
https://github.com/angular/material/blob/master/src/components/button/button.js#L75

Which calls some of this code:
https://github.com/angular/material/blob/master/src/core/services/ripple/ripple.js#L64-L101

Which is using the $md.pressdown event. I'm at work right now, but I'll make a PR later (if no one else does) that checks to see if the user moved their finger within the first N milliseconds of touching down and cancels the ripple accordingly.

Not sure about the flicker problem though?

@ThomasBurleson ThomasBurleson modified the milestone: 0.9.0 Mar 12, 2015
@srdone
Copy link
Author

srdone commented Mar 13, 2015

I'm pretty confident the flickering is caused directly by the ripple animation starting during a scroll event. When I scroll on my iPhone and avoid touching any part of the screen where a ripple effect might happen, I do not see the flickering. If we can stop the ripple animation from firing during a scroll event, my hunch is that the flickering issue will disappear.

@srdone
Copy link
Author

srdone commented Mar 26, 2015

See issue #1847. This is happening because the tooltip doesn't have a default delay value. Adding md-delay="400" to the md-tooltip directive fixes the issue by delaying the animation long enough so a scroll event doesn't trigger the animation. It gets rid of the flickering issue. Thanks to @superbullock for the idea to look for a built in way to delay the animation. Closing and referring to the other issue.

@srdone srdone closed this as completed Mar 26, 2015
@tam3r
Copy link

tam3r commented Mar 27, 2015

the issue concerns any element with ripple animation attached. Say, I have a bunch of div's with md-ink-ripple . The suggested md-delay solution does not seem to work in that case. I'd say ripple animation should only be triggered if touchmove event does not fire.

@srdone
Copy link
Author

srdone commented Apr 1, 2015

@tam3r I think you are right - I am still seeing the flickering issue when I accidentally touch a button during a scroll event.

@srdone srdone reopened this Apr 1, 2015
@marcysutton marcysutton modified the milestones: 0.10.0, 0.9.0 Apr 14, 2015
@ThomasBurleson ThomasBurleson modified the milestones: 0.10.0, 0.11.0 Jun 16, 2015
@ThomasBurleson ThomasBurleson self-assigned this Aug 10, 2015
@ThomasBurleson
Copy link
Contributor

References #3952

@naomiblack naomiblack modified the milestones: 0.12.0, 0.11.0 Aug 14, 2015
@naomiblack naomiblack added this to the 0.11.0 milestone Aug 14, 2015
@robertmesserle robertmesserle modified the milestones: 0.11.0, 0.12.0 Aug 17, 2015
@ThomasBurleson ThomasBurleson modified the milestones: 1.0-rc1, 1.0-rc2, 1.0-rc3 Oct 27, 2015
@robertmesserle robertmesserle modified the milestones: post-1.0 , 1.0-rc3 Nov 3, 2015
@ThomasBurleson ThomasBurleson modified the milestones: post-1.0 , Backlog Jan 5, 2016
@ThomasBurleson ThomasBurleson modified the milestones: Backlog, Deprecated Apr 20, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants