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

fix(ripple): Fix the ripple position #1820

Closed
wants to merge 0 commits into from

Conversation

tinayuangao
Copy link
Contributor

When scroll down the page, the ripple position is off

Closes #1817

R: @kara

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 11, 2016
@@ -154,7 +154,7 @@ export class MdRipple implements OnInit, OnDestroy, OnChanges {
// FIXME: This fails on IE11, which still sets pageX/Y and screenX/Y on keyboard clicks.
const isKeyEvent =
(event.screenX === 0 && event.screenY === 0 && event.pageX === 0 && event.pageY === 0);
this.end(event.pageX, event.pageY, isKeyEvent);
this.end(event.pageX, event.pageY - document.body.scrollTop, isKeyEvent);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That page could be horizontally scrolled as well, so you should account for scrollLeft on the x-axis.

Does this still work if another element is scrolled other than body? Is there a unit test we can add for this? (connected position strategy has a lot of tests that deal with this type of thing).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed firefox & scrollLeft. Now it's working with elements other than body.

Working on unit test for this...

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement in progress This issue is currently in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ripple positioning is off beneath the fold
3 participants