From 409ad136494f4c9b8569e649f34beae70fb7874f Mon Sep 17 00:00:00 2001 From: saifsultanc Date: Sat, 28 Jun 2025 11:56:42 +0530 Subject: [PATCH] `gw-gravity-forms-rounding.php`: Fixed an issue with rounding now updating form total. --- gravity-forms/gw-gravity-forms-rounding.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gravity-forms/gw-gravity-forms-rounding.php b/gravity-forms/gw-gravity-forms-rounding.php index 93d55ff9b..9fa989fac 100644 --- a/gravity-forms/gw-gravity-forms-rounding.php +++ b/gravity-forms/gw-gravity-forms-rounding.php @@ -189,6 +189,9 @@ function output_script() { var value = self.getRoundedValue( $input ); if( $input.val() != value ) { $input.val( value ).change(); + const input = $input[0]; + // Ensure Gravity Forms detects the programmatic value change by dispatching a native input event + input.dispatchEvent( new Event( 'input', { bubbles: true } ) ); } }; @@ -216,7 +219,7 @@ function output_script() { } - if( value != '' ) { + if( value !== '' ) { for( var i = 0; i < actions.length; i++ ) { value = GWRounding.round( value, actions[i].actionValue, actions[i].action ); }