Skip to content

Commit

Permalink
🐞 Double click is needed to deselect (#442) (#443)
Browse files Browse the repository at this point in the history
Parent issue: sequentech/meta#911
  • Loading branch information
Findeton committed May 15, 2024
1 parent 5920f47 commit 1a80a62
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ angular.module('avBooth')

scope.clickOnCumulative = function (question, option)
{
var isInvalid = question.invalidVoteAnswer && question.invalidVoteAnswer.id === option.id;
// number of checkboxes
var maxNum = question.extra_options.cumulative_number_of_checkboxes;

Expand All @@ -455,7 +456,7 @@ angular.module('avBooth')
.filter(function (el) { return el; }).length;

// all checked, next step is to uncheck
if (numChecks >= maxNum) {
if (numChecks >= maxNum || (isInvalid && numChecks > 0)) {
scope.deselectAllCumulative(question, option);
question.deselectedAtLeastOnce = true;
option.selected = -1;
Expand Down

0 comments on commit 1a80a62

Please sign in to comment.