From b921edeed2e2268dcae0c933f22620a0d72ed921 Mon Sep 17 00:00:00 2001 From: Mats Pfeiffer Date: Thu, 17 May 2018 08:57:35 +0200 Subject: [PATCH] fix(list): Set ripple on class changes BREAKING CHANGES: Removed interactive prop, ripple effect is now default. --- components/list/ListItem.vue | 39 ++++++++++++++++++------------------ components/list/README.md | 1 - 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/components/list/ListItem.vue b/components/list/ListItem.vue index b5c571193..237b0cbef 100644 --- a/components/list/ListItem.vue +++ b/components/list/ListItem.vue @@ -1,25 +1,25 @@ @@ -31,10 +31,6 @@ import themeClassMixin from '../base/themeClassMixin.js' export default { mixins: [themeClassMixin], props: { - interactive: { - type: Boolean, - default: false - }, activated: { type: Boolean, default: false @@ -58,23 +54,28 @@ export default { } } }, + watch: { + classes () { + this.mdcRipple.destroy() + this.mdcRipple = MDCRipple.attachTo(this.$el) + } + }, mounted () { this.updateSlots() - this.slotObserver = new MutationObserver( () => this.updateSlots()) + this.slotObserver = new MutationObserver(() => this.updateSlots()) this.slotObserver.observe(this.$el, { childList: true, subtree: true }) - - if (this.interactive) { this.mdcRipple = MDCRipple.attachTo(this.$el) } + this.mdcRipple = MDCRipple.attachTo(this.$el) }, beforeDestroy () { this.slotObserver.disconnect() - if (typeof this.mdcRipple !== 'undefined') { - this.mdcRipple.destroy() + if (typeof this.mdcRipple !== 'undefined') { + this.mdcRipple.destroy() } }, - methods: { + methods: { updateSlots () { if (this.$slots.graphic) { this.$slots.graphic.map(n => { diff --git a/components/list/README.md b/components/list/README.md index e86aa63f6..bc27833d8 100644 --- a/components/list/README.md +++ b/components/list/README.md @@ -72,7 +72,6 @@ | Prop | Type | Default | Description | |------|------|---------|-------------| -| interactive | Boolean | false | ripple effect | | activated | Boolean | false | activated item | | selected | Boolean | false | selected item |