verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
96 stars 72 forks source link

Issue with Stripe and calculation field #2081

Closed Megafry closed 1 month ago

Megafry commented 1 month ago

Describe the bug

Stripe doesn't work if the dynamic value for the payment amount is linked to a calculation field.

fix: after the calculation, the field should dispatch a bubbles input event:

dispatchEvent( new Event("input", { bubbles: !0 }) )

Steps to reproduce

  1. Add a field type number.
  2. Add a calculation field that multiplies the value from the number field.
  3. Add a Stripe payment field.
  4. Set the calculation field as the dynamic value.
  5. In the frontend, set a value to the number field.
  6. The Stripe payment doesn't notice the change from the calculation field.

Form settings

Craft CMS version

5.4.6

Plugin version

3.0.7

Multi-site?

No

Additional context

No response

engram-design commented 1 month ago

We actually already do that, but the issue is that we're debouncing listening for input events, and that'll be due to the change being triggered for both the source input for the calculations field and the calculations field.

Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-5 as 3.0.7".

engram-design commented 1 month ago

Fixed in 3.0.8