Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

round-start-rating is respected after first hover #36

Closed
sventendo opened this issue Jun 22, 2018 · 1 comment
Closed

round-start-rating is respected after first hover #36

sventendo opened this issue Jun 22, 2018 · 1 comment
Labels

Comments

@sventendo
Copy link

This is how I set the initial rating.

    <star-rating ref="widget"
        v-model="rating"
        @rating-selected="setRating"
        :round-start-rating="false">
     </star-rating>

        beforeMount: function() {
            this.ratingIdentifier = this.getRatingIdentifier();
            this.readOnly = undefined !== localStorage[this.ratingIdentifier];
            this.maxRating = window.vueData.rating.maxRating;
            this.getRating();
        },
        methods: {
            getRating: function() {
                  // 3.5 is actually from an async callback
                  this.rating = 3.5;
            }
        }

Expected behavior:

  • initial rating shows 3 1/2 stars.
  • rating should be possible in increments of 1, no half stars

Actual behavior:

  • initial rating shows as 4 stars.
  • rating is possible in increments of 1, no half stars
  • after hovering (not selecting anything) the widget shows a rating of 3 1/2 stars.

Am I setting the rating at a wrong time?

I'm using version 1.6

@craigh411 craigh411 added the bug label Jun 22, 2018
@craigh411
Copy link
Owner

Thanks for opening the issue, this shouldn't happen, but it appears to be an issue with the async call. I've set up a JSFiddle to show the issue: https://jsfiddle.net/fhj35zq0/22/ and I'll look in to getting this fixed ASAP,

craigh411 added a commit that referenced this issue Oct 29, 2018
Fixes an issue where round-start-rating doesn't correctly
apply when initial rating is set using an async call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants