"Unvote" a poll

Hi, I’ve just pulled down the latest build to my dev environment to test this and I’ve noticed a small, perhaps non-intentional change.

It’s a small change, but it’s significant to me due to the quirky way I use polls.

Previously, if there were no votes in the poll, the “Show results” button would be disabled. That made sense, there are no results to see so the “Show results” button shouldn’t be pressable. It looked like this…


Notice there have been no votes and the “Show results” button is disabled

In the new “Unvote” build it appears that the “Show Results” button is always enabled whether there have been votes or not.


Notice there have been no votes cast but the “Show results” button is enabled

Some questions: Is this the case? Was this intentional or an oversight? Will you be changing it back?

If it’s staying the way it is, then I’ll try another way to achieve my desired outcome.

Either way thanks for the unvote feature which seems to work very well!

Background

Background…

Why is this an issue to me? I use polls to capture the input from (mostly) individual users. i.e. a poll allows me to ask specific questions of an individual user in a specific context. There is seldom more than one vote in a poll but they make gathering structured data very easy.

In my plugin, a topic can feature many polls and these polls can feature lots of options which means a lot of scrolling. To make it easier for the users to navigate, once they have voted, a theme component I wrote removes the other options from the poll UI leaving only the option they selected.

To remove these options, my theme component targets an enabled “Show results” button and “clicks” it, once the results are shown, any options that have no votes are removed.

It ends up looking like this.

At the moment, because the “Show results” button is enabled by default, my code clicks it and as there haven’t been any votes, all of the options are removed and it looks like this…