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

Commit 42c80f7

Browse files
committed
fix(ripple): use contentParent scroll offset
Closes #416.
1 parent f5cccc5 commit 42c80f7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/components/animate/inkCssRipple.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ function InkRippleService($window, $$rAF, $mdEffects, $timeout, $mdUtil) {
6363
function attach(element, options) {
6464
// Parent element with noink attr? Abort.
6565
if (element.controller('noink')) return angular.noop;
66+
var contentParent = element.controller('materialContent');
6667

6768
options = angular.extend({
6869
mousedown: true,
@@ -125,6 +126,10 @@ function InkRippleService($window, $$rAF, $mdEffects, $timeout, $mdUtil) {
125126
top -= elementRect.top;
126127
}
127128

129+
if (contentParent) {
130+
top += contentParent.prop('scrollTop');
131+
}
132+
128133
var css = {
129134
'background-color': $window.getComputedStyle(rippleEl[0]).color ||
130135
$window.getComputedStyle(node).color,

0 commit comments

Comments
 (0)