From e9261b8732dc8ee0801be2f6f998d498c5ee4bed Mon Sep 17 00:00:00 2001 From: Marcos Moura Date: Mon, 13 Feb 2017 01:35:42 -0200 Subject: [PATCH] prevent ripple from being created multiple times in parent --- src/core/components/mdInkRipple/mdInkRipple.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/core/components/mdInkRipple/mdInkRipple.vue b/src/core/components/mdInkRipple/mdInkRipple.vue index 431923d..e6cb461 100644 --- a/src/core/components/mdInkRipple/mdInkRipple.vue +++ b/src/core/components/mdInkRipple/mdInkRipple.vue @@ -188,13 +188,18 @@ this.parentElement = this.getClosestPositionedParent(this.$el.parentNode); this.previous = ['mouse']; - if (!this.parentElement) { - this.$destroy(); - } else { + if (this.parentElement) { this.rippleElement.parentNode.removeChild(this.rippleElement); - this.parentElement.appendChild(this.rippleElement); - this.registerTriggerEvent(); - this.setDimensions(); + + if (this.parentElement.querySelectorAll('.md-ink-ripple').length > 0) { + this.$destroy(); + } else { + this.parentElement.appendChild(this.rippleElement); + this.registerTriggerEvent(); + this.setDimensions(); + } + } else { + this.$destroy(); } }, destroy() {