From 97d5f77c07e7578635738e023a08ff25baca0553 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Mon, 9 Oct 2023 18:17:50 -0300 Subject: [PATCH] fix: also watch changes to the frequency input --- src/blocks/donate/frequency-based/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/blocks/donate/frequency-based/index.ts b/src/blocks/donate/frequency-based/index.ts index 2ebb40cbd..dbed4edd7 100644 --- a/src/blocks/donate/frequency-based/index.ts +++ b/src/blocks/donate/frequency-based/index.ts @@ -30,6 +30,7 @@ const resetOtherValue = ( container: HTMLElement ) => { if ( ! frequencies?.length ) { return; } + const frequencyInputs = container.querySelectorAll( 'input[name="donation_frequency"]' ); frequencies.forEach( frequency => { const tiers = frequency.querySelectorAll( 'input[type="radio"]' ); const input = frequency.querySelector( '.money-input input' ); @@ -43,6 +44,9 @@ const resetOtherValue = ( container: HTMLElement ) => { tiers.forEach( tierInput => { tierInput.addEventListener( 'change', reset ); } ); + frequencyInputs.forEach( frequencyInput => { + frequencyInput.addEventListener( 'change', reset ); + } ); } ); };