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

Issues with voting on Proposals #714

Open
Vibhu-Agarwal opened this issue Jul 27, 2020 · 3 comments
Open

Issues with voting on Proposals #714

Vibhu-Agarwal opened this issue Jul 27, 2020 · 3 comments

Comments

@Vibhu-Agarwal
Copy link

Watch the Screencast on YouTube

I tried to upvote to check if it's possible to do it on our own submissions. Initially, the number of votes on it was 2.

  • On clicking upvote, the number changed from 2 to 3, a bluish highlight on the up arrow. Works fine.
  • My first instinct to remove my upvote was to click the downvote button, then it changed from 3 to 1. This seemed like a bug at first, then I understood that the downvote must've decreased the original number (2) by 1.
  • To remove the downvote, I tried to it the right way by re-clicking the downvote button, but nothing happened. On clicking the upvote button, it jumped to 3 again.
  • After refreshing the page, the arrow gets highlighted with a different colour, indicating the correct vote marked. After clicking on that (marked) arrow, the initial number is restored. But then the colour doesn't get back to the original one (On refreshing the page, it does).
  • Also, it seems like the bluish colour is temporary and can be removed by clicking anywhere else on the screen.

Browser: Mozilla Firefox 74.0

I don't know which of the issues I listed are features working as-intended, but the current UX certainly have some problems.

@RajatRajdeep
Copy link
Contributor

To me the expected behaviour should be:

  • Upvote button behaviour:
    1. When the current user has not upvoted or downvoted the post (grey upvote button with blue hover effect): Clicking the upvote button should increase the vote count by 1, change the upvote button color to red.
    2. When the current user has already upvoted the post (red upvote button with no hover effect): Clicking the upvote button should decrease the vote count by 1, change the upvote button color to grey.
    3. When the current user has already downvoted the post (red downvote button with no hover effect): Clicking the upvote button should increase the vote count by 2, change the upvote button color to red, and change the downvote button color to grey.
  • Downvote button behaviour:
    1. When the current user has not upvoted or downvoted the post (grey downvote button with blue hover effect): Clicking the downvote button should decrease the vote count by 1, change the button color to red.
    2. When the current user has already downvoted the post (red button with no hover effect): Clicking the downvote button should increase the vote count by 1, change the button color to grey.
    3. When the current user has already upvoted the post (red upvote button with no hover effect): Clicking the downvote button should decrease the vote count by 2, change the downvote button color to red, and change the upvote button color to grey.
      This behaviour is similar to the Reddit upvote/downvote feature.

Please take a moment to review this behaviour and confirm that it meets the expectations? Once I receive the approval, I will proceed with implementing the changes and submit a pull request.

RajatRajdeep pushed a commit to RajatRajdeep/junction that referenced this issue May 19, 2023
@RajatRajdeep
Copy link
Contributor

The issue occurred because proposals/detail/comments.html is included multiple times in the proposals/detail/base.html.
And due to this when clicking on the vote button jQuery vote handler gets multiple times.
I am working on this and will raise a PR.

@RajatRajdeep
Copy link
Contributor

RajatRajdeep commented May 23, 2023

Raised following PR for the fix: #764
PR changes:
Added event.stopImmediatePropagation() in jQuery vote lister so it gets triggered only once.

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

5 participants