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

Commit 664ab99

Browse files
fix(ripple): ripple container self-removal NPE fixed.
1 parent ecea594 commit 664ab99

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

src/components/animate/inkCssRipple.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,22 @@ function InkRippleService($window, $$rAF, $materialEffects, $timeout) {
7878
var node = element[0];
7979

8080
if (options.mousedown) {
81-
enableMousedown(true);
81+
listenPointerDown(true);
8282
}
8383

8484
// Publish self-detach method if desired...
8585
return function detach() {
86-
enableMousedown(false);
86+
listenPointerDown(false);
8787

88-
rippleContainer
89-
.parent
88+
if ( rippleContainer ) {
89+
// Self-removal of injected container...
90+
rippleContainer
91+
.parent()
9092
.remove( rippleContainer );
91-
}
93+
}
94+
};
9295

93-
function enableMousedown(active) {
96+
function listenPointerDown(active) {
9497
if ( !active) element.off(POINTERDOWN_EVENT, onPointerDown);
9598
else element.on(POINTERDOWN_EVENT, onPointerDown);
9699
}

0 commit comments

Comments
 (0)