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

Enforce maxRating limit in RatingBar value calculation #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Rasubosu
Copy link

@Rasubosu Rasubosu commented Jan 13, 2024

Dear sarbagyastha

Issue:
We observed that tapping on the rating bar could inadvertently allow users to set a rating higher than the maxRating, which should not be possible. This inconsistency can lead to unexpected behavior, particularly when a specific maxRating is set.

Implemented Fix:
To resolve this, I have adjusted the rating calculation logic to ensure that the rating value does not go beyond maxRating when the widget is tapped. The key change is:

value = math.min(value, widget.maxRating ?? widget.itemCount.toDouble());

Here is a video of the issue

Enforce.maxRating.limit.in.RatingBar.value.calculation.2024-01-13.23.44.43.mov

Thank you for your time.

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

Successfully merging this pull request may close these issues.

None yet

1 participant