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

enhancement: need config parameter min-rating #22

Closed
franktopel opened this issue Oct 18, 2017 · 4 comments
Closed

enhancement: need config parameter min-rating #22

franktopel opened this issue Oct 18, 2017 · 4 comments

Comments

@franktopel
Copy link

franktopel commented Oct 18, 2017

As of now, even with a stepping of 1, it is possible to give a 0-stars rating. Most existing implementations require that the user can vote only between 1 and 5 stars.

It should be possible to configure a minimum rating value. Of course this can be done using the rating-selected event handler (like not applying the vote if the value is less than 1 or whatever the user wants as a minimum), but since this will be a standard requirement this should probably be implemented as a config option min-rating.

@franktopel franktopel changed the title feature request: need config parameter min-rating enhancement: need config parameter min-rating Oct 18, 2017
@craigh411
Copy link
Owner

craigh411 commented Oct 29, 2017

Thanks for the feedback. I've given this a little thought and I'm not sure there is much of a use case for this because it can already be done with v-model:

<star-rating v-model="rating"></star-rating>
new Vue({
  el: '#app',
  data: {
    rating: 1
  }
});

Here's the JSFiddle: https://jsfiddle.net/k0x9ayws/

Once set to 1 there isn't any way to set it to 0 without writing that implementation yourself and I can't see anybody needing to set a min-rating other than 1. I'm going to close this issue because such an implementation could cause conflicts with other props with little benefit to the majority of users.

@franktopel
Copy link
Author

franktopel commented Oct 30, 2017

I just created a zero rating in your fiddle example by clicking to the very leftmost part of the stars, which is exactly the issue I was addressing.

@craigh411
Copy link
Owner

Ah, OK. That shouldn't happen, it makes no sense to have to click a 1 pixel column to reset the value, I'll get that fixed.

@craigh411 craigh411 reopened this Oct 30, 2017
@craigh411
Copy link
Owner

Fixed in version 1.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants