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

Commit 313342c

Browse files
author
Robert Messerle
committed
fix(ripple): ripple will no longer be triggered on disabled elements
Closes #5445
1 parent c7f2d64 commit 313342c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/core/services/ripple/ripple.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,21 @@ InkRippleCtrl.prototype.clearTimeout = function () {
194194
}
195195
};
196196

197+
InkRippleCtrl.prototype.isRippleAllowed = function () {
198+
var element = this.$element[0];
199+
do {
200+
if (element && element.hasAttribute && element.hasAttribute('disabled')) return false;
201+
} while (element = element.parentNode);
202+
};
203+
197204
/**
198205
* Creates a new ripple and adds it to the container. Also tracks ripple in `this.ripples`.
199206
* @param left
200207
* @param top
201208
*/
202209
InkRippleCtrl.prototype.createRipple = function (left, top) {
210+
if (!this.isRippleAllowed()) return;
211+
203212
var ctrl = this;
204213
var ripple = angular.element('<div class="md-ripple"></div>');
205214
var width = this.$element.prop('clientWidth');

0 commit comments

Comments
 (0)