mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Disable ‘dirty form’ fix in onboarding JS as it conflicts with other handlers
This commit is contained in:
parent
5ad190aed0
commit
5c467b2188
1 changed files with 21 additions and 4 deletions
|
@ -173,12 +173,29 @@ const disconnect = (event) => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
document.querySelectorAll('#mainform input[type="checkbox"]').forEach(
|
// Prevent a possibly dirty form arising from this particular checkbox.
|
||||||
(checkbox) => {
|
sandboxSwitchElement.addEventListener(
|
||||||
checkbox.addEventListener('click', checkBoxOnClick);
|
'click',
|
||||||
|
(event) => {
|
||||||
|
const value = event.target.checked;
|
||||||
|
|
||||||
|
toggleSandboxProduction( ! value );
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
setTimeout( () => {
|
||||||
|
event.target.checked = value;
|
||||||
|
}, 1
|
||||||
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// document.querySelectorAll('#mainform input[type="checkbox"]').forEach(
|
||||||
|
// (checkbox) => {
|
||||||
|
// checkbox.addEventListener('click', checkBoxOnClick);
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
|
||||||
document.querySelectorAll('#field-sandbox_toggle_manual_input button, #field-production_toggle_manual_input button').forEach(
|
document.querySelectorAll('#field-sandbox_toggle_manual_input button, #field-production_toggle_manual_input button').forEach(
|
||||||
(button) => {
|
(button) => {
|
||||||
button.addEventListener(
|
button.addEventListener(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue