-
Notifications
You must be signed in to change notification settings - Fork 6.7k
[uib-rating] disable reset to zero (feature) #5532
Comments
@startswithaj, while at first glance, this appears to be well written, is there any particular reason you did not use our issue template? In the future, please do not remove it unless absolutely appropriate. The template makes our job significantly easier and thus, allows us to help you faster. |
Maybe we could have a configuration value like |
Why does it have to reset at all? @icfantv I didn't use it because I don't have a repro, because its the standard use. And its not a bug its a feature. but ill add it back in for you. |
Otherwise there is no way to clear it without having to add additional controls - this is also how most rating systems work in the UI. |
You could use the readonly attribute if you want to disable modifications dynamically. |
Ok no worries, I hadn't seen this behaviour before but TBH I haven't used many rating systems. I don't want to disable modifications. I think my feature request makes that pretty clear. Once a user rates something I don't want them to be able to reset it to zero. This seems like a pretty logical use case. In reality rating-default is achievable without and code changes, you can just get the ng-model value in your ng-change function and if its 0 just change it back to your default. The point of my change request is not to have it reset/default at all. |
Wouldn't using the documented |
No the readonly attribute stops all modifications. I would like the user to be able can change the value, from 1-5 they just cannot reset it to 0. |
That sounds like a strange UX...why would you prevent resetting it? |
How is it strange mate? You have a survey. The survey has answers between 1-5 that default to 3. 3 being neutral. How is this strange. Show me an example of a resetting rating? I can't find one. IMDB for instance? 1-5 stars. Why are you in the first place setting an element that represents a y to z value to x?
|
Why wouldn't I prevent resetting it? Why have a min and max value on any user input? How longs a piece of string?
|
It is strange because it forces on the user a disabling of an action they may want to take - for example a lot of people like to clear certain form values because it helps them think clearer before filling it in, especially for things that require thought like ratings. As for an example of a rating that clears, Amazon product reviews. |
Why keep suggesting readonly when it has absolutely nothing todo with what I'm talking about. Honestly.
|
Stick to purely the issue here - if I see a comment that attempts to steer conversation away or only tries to inflame/disrespect/etc., I will lock the issue and ban from filing issues. |
That's why it's a feature mate, I'm not saying everyone should be forced to use it. It would default to the normal behaviour it's not a BC change. As the designer of the workflow I decide what the user can or can't do. Not Ng bootstrap contributors. Why make a non bc breaking change so difficult this is why I didn't go to the trouble of making the pr because in repos like this small non breaking changes are meet with such epic resistance for NO REASON except someone's sore feelings and attachment to arbitrary bits of code. Just because Amazon allow a non rating doesn't mean every other use of rating is nullable.
|
Going to leave a comment and close this issue for now since you are refusing to follow the Code of Conduct due to being in a highly charged emotional state & are throwing out unhelpful attacks. The reason why we, and any major open source maintainer, are careful in what we add is because we are stuck with the maintenance burdens, and we are responsible for making sure the library isn't bloated or encouraging bad patterns. Little bloat adds up, and it often trades off increased size & hurts most users of the library for undesired features. Your behavior in this issue is completely unacceptable, and nothing I have said has warranted these attacks. If you cannot remain professional, then we as a team will not be held back wasting our time trying to help figure out the best course of action. This is one of the major plagues when it comes to stalling progress in open source, and everyone suffers. |
Re-opening as per email conversation |
I know it's not a real solution, but you can always do something like this -
If i'll have time i'll create a PR this weekend |
Bug description:
When using the uib-rating directive if you click the star of the current value (i.e 3rd star selected. click 3rd star again) it sets the current value to 0 essentially resetting the rating.
The code that does this:
Version of Angular, UIBS, and Bootstrap: Current
My current use case:
Rating defaults to 3/5 and should not be able to be set to zero.
Proposed fixes:
If set to true then when clicking the current value would just set the value again.
The uib-control would not allow a rating less than the given int. ie In the use case above i would set min=1. If the user click 3 rating while already selected it would reset back to 1 rather than zero.
I would be happy to code and submit a pull request for this feature if it would likely be merged.
The text was updated successfully, but these errors were encountered: