mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +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(
|
||||
(checkbox) => {
|
||||
checkbox.addEventListener('click', checkBoxOnClick);
|
||||
// Prevent a possibly dirty form arising from this particular checkbox.
|
||||
sandboxSwitchElement.addEventListener(
|
||||
'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(
|
||||
(button) => {
|
||||
button.addEventListener(
|
||||
|
@ -192,4 +209,4 @@ const disconnect = (event) => {
|
|||
}
|
||||
)
|
||||
|
||||
})();
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue