PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.8.1
GiveWP – Donation Plugin and Fundraising Platform v4.16.8.1
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / src / DonationForms / resources / app / hooks / useFormSubmitButton.ts

useFormSubmitButton.ts in GiveWP – Donation Plugin and Fundraising Platform 4.16.8.1, at src/DonationForms/resources/app/hooks/useFormSubmitButton.ts

22 lines 647 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * @since 4.1.1 updated the selector to use the next button classname
3 * @since 4.0.0
4 */
5 export default function useFormSubmitButton(): HTMLButtonElement | null {
6 const donationFormWithSubmitButton = Array.from(document.forms).pop();
7
8 const submitButton: HTMLButtonElement = donationFormWithSubmitButton?.querySelector('[type="submit"]');
9 if (submitButton) {
10 return submitButton;
11 }
12
13 const nextButton: HTMLButtonElement = donationFormWithSubmitButton?.querySelector(
14 '.givewp-donation-form__steps-button-next[type="button"]'
15 );
16 if (nextButton) {
17 return nextButton;
18 }
19
20 return null;
21 }
22