-
Notifications
You must be signed in to change notification settings - Fork 91
gw-choice-counter.php
: Fixed an issue with Choice Counter not working for Image Choice field.
#1083
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
gw-choice-counter.php
: Fixed an issue with Choice Counter not working for Image Choice field.
#1083
Conversation
…ng for Image Choice field.
Caution Review failedThe pull request is closed. WalkthroughThe change updates the Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
…ng for Image Choice field.
…ng for Image Choice field.
Context
⛑️ Ticket(s): https://secure.helpscout.net/conversation/2917523082/82535
Summary
The Choice Counter is not working with Image Choice Field. The count is 1 off; you select two, it shows 1. You select 3 it'll show 2.
This update addresses an off-by-one issue when counting selected options in Gravity Forms' Image Choice fields. The problem occurs because clicking on an image triggers a click on the associated label, which then toggles the underlying checkbox. However, the checkbox state wasn't immediately updated at the time of the event, so there was a slight delay before the DOM reflected the change.
Previously, the count was being calculated immediately on click, which sometimes captured the state before the checkbox had updated, leading to inaccurate totals.
BEFORE:

AFTER:
