Skip to content

Commit

Permalink
fix: also watch changes to the frequency input
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelpeixe committed Oct 9, 2023
1 parent a301f5c commit 97d5f77
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/blocks/donate/frequency-based/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <HTMLInputElement>frequency.querySelector( '.money-input input' );
Expand All @@ -43,6 +44,9 @@ const resetOtherValue = ( container: HTMLElement ) => {
tiers.forEach( tierInput => {
tierInput.addEventListener( 'change', reset );
} );
frequencyInputs.forEach( frequencyInput => {
frequencyInput.addEventListener( 'change', reset );
} );
} );
};

Expand Down

0 comments on commit 97d5f77

Please sign in to comment.