Disable ‘dirty form’ fix in onboarding JS as it conflicts with other handlers

This commit is contained in:
Jorge A. Torres 2020-10-15 15:42:49 -03:00
parent 5ad190aed0
commit 5c467b2188

View file

@ -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) => {
}
)
})();
})();