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

Support for fractions in rate component #3207

Open
spacecat opened this issue May 21, 2023 · 5 comments
Open

Support for fractions in rate component #3207

spacecat opened this issue May 21, 2023 · 5 comments

Comments

@spacecat
Copy link

I believe that this feature would be of great value. It's a pretty common scenario/requirement and I think it would make the rate component even more awesome. https://rsuitejs.com/components/rate/

Example:
https://codepen.io/colinlord/pen/bERrgJ

Also, this feature should work nicely with https://rsuitejs.com/components/rate/#vertical-direction as well.

@simonguo
Copy link
Member

If only considering the display of the Rate component, it is relatively simple. However, supporting click-to-select interaction can be more complicated.

@spacecat
Copy link
Author

Display of rate component should be enough for 99% of use cases I believe.

Not sure what you mean by click to select interaction? Can you please give more details?

@SevenOutman
Copy link
Member

SevenOutman commented Aug 25, 2023

IMHO, Rate widget is not for displaying precise values, but for displaying levels. You can't expect users to read the precise value from a Rate widget without displaying the exact value alongside with it. The Rate widget only conveys the message "these two are 8 out of 10" and "those two are 9 out of 10".

image

And as @simonguo mentioned, it's not easy for users to select a expected value as precisely by clicking on the rate widget - how could I avoid clicking at 4.6 when I actually want to rate 4.5?

@spacecat
Copy link
Author

@SevenOutman Fractional values is a pretty common practice in e-commerce.

Here's an example:

https://jimmyjoy.com/products/reusable-jimmy-joy-pot

And yes, you should always display the actual value as well as the icons for a good user experience.

About the clicking/tapping on the widget to select a value; you should only be able to select 1, 2, 3, 4, 5 in a 5-star rate widget. You should not be able to select for instance 2.3, 2.67, 2.5, 2.4563. Also, selecting fractional values doesn't make any sense on a smartphone and neither should you want/need to.

So again just to summarize. The fractional values are only for displaying, not for selecting. And the value should be displayed with the icons if you care about ux :)

@SevenOutman
Copy link
Member

SevenOutman commented Aug 28, 2023

About the clicking/tapping on the widget to select a value; you should only be able to select 1, 2, 3, 4, 5 in a 5-star rate widget. You should not be able to select for instance 2.3, 2.67, 2.5, 2.4563. Also, selecting fractional values doesn't make any sense on a smartphone and neither should you want/need to.

So again just to summarize. The fractional values are only for displaying, not for selecting. And the value should be displayed with the icons if you care about ux :)

@spacecat That makes sense then. Given the current implementation of Rate, I would like to add this feature in v6 and see if it's possible to backport to v5 without breaking things.

@SevenOutman SevenOutman removed the status: Needs Triage New issues that has not been looked into label Aug 28, 2023
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

3 participants