diff --git a/src/components/mdRatingBar/mdRatingBar.vue b/src/components/mdRatingBar/mdRatingBar.vue index d83fc48..0796347 100644 --- a/src/components/mdRatingBar/mdRatingBar.vue +++ b/src/components/mdRatingBar/mdRatingBar.vue @@ -78,12 +78,13 @@ this.$emit('change', selected / this.mdNumStars); } }, - getIconIndex(iconSelected) {//icon is a dom element + getIconIndex(iconSelected) {//iconSelected is a dom element let ratingIcons = this.$el.querySelectorAll('.md-back-stars > .md-icon, .md-front-stars > .md-icon'); let selected = -1; ratingIcons = Array.prototype.slice.call(ratingIcons); - ratingIcons.some((icon, i) => {//find index + //find index from iconSelected + ratingIcons.some((icon, i) => { if (icon === iconSelected) { selected = (i + 1) % this.mdNumStars; selected = !selected ? this.mdNumStars : selected;