-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
revert(ripple): handle touch events #7557
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this could end up breaking the ripples.
this._isPointerDown = true; | ||
this.fadeInRipple(event.clientX, event.clientY, this.rippleConfig); | ||
this._isMousedown = true; | ||
this.fadeInRipple(event.pageX, event.pageY, this.rippleConfig); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, just took another look. This should use clientX
and clientY
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated it and fixed a lint error. Please have another look.
058fecc
to
7d2e294
Compare
Reverts the `ripple(): handle touch events` commit from PR#7299. With the current touch solution, ripples are showing up twice on click. This is because after a `touchstart` event, the touch browser fires a `mousedown` event. This causes the ripple renderer to fade in another ripple from the `mousedown` event. There are solutions like: * Timeout to ignore `mousedown` events * Calling `preventDefault` / `stopPropagation` on `touchstart` * Listening to `pointerdown`, `pointerup`, `pointerleave` events * Using feature detecton (as in Modernizr) All of those solutions have negative aspects on the UX of the ripples and need to be evaluated with more testing. For now the ripples are broken and should be fixed as soon as possible. This is going to be revisited.
7d2e294
to
89cad8b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Reverts the
ripple(): handle touch events
commit from PR #7299. With the current touch solution, ripples are showing up twice on click.This is because after a
touchstart
event, the touch browser fires amousedown
event. This causes the ripple renderer to fade in another ripple from themousedown
event.There are solutions like:
mousedown
eventspreventDefault
/stopPropagation
ontouchstart
pointerdown
,pointerup
,pointerleave
eventsAll of those solutions have negative aspects on the UX of the ripples and need to be evaluated with more testing.
For now the ripples are broken and should be fixed as soon as possible. This is going to be revisited.