-
Notifications
You must be signed in to change notification settings - Fork 92
gw-choice-counter.php: Fixed Choice Counter not triggering quantity updates.
#1046
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
Conversation
WalkthroughThe changes add a new line of code inside the Changes
Sequence Diagram(s)sequenceDiagram
participant Script as output_script
participant CountField as Count Field
participant Listener as Native Event Listener
Script->>CountField: Update value and trigger jQuery .change()
Script->>CountField: Dispatch native change event (bubbles: true)
CountField->>Listener: Native event captured and propagated
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (1)
✨ Finishing Touches
🪧 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 (
|
veryspry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Untested on my part but the code looks good to me :)
Thanks for confirming that this works with the GF listener stuff too!
Context
⛑️ Ticket(s): https://secure.helpscout.net/conversation/2866195352/78865
Summary
The snippet above is used to get the number of selected choices in a multi-choice field. It works, but it appears it doesn't properly trigger the change event, which also doesn't update the form total.
Fix to ensure the change event triggers properly. This would include native event listeners and Gravity Forms logic.
BEFORE:
https://www.loom.com/share/53434d41b639452f8162cb6f1c33fe4e
AFTER:
https://www.loom.com/share/3ff480ee39254a3f895d785945b79cef