Don't submit form on hitting enter

This commit is contained in:
Wuzzy 2023-10-28 09:37:32 +02:00
parent 8ba69fea5e
commit 06fe976a66

View File

@ -2452,6 +2452,16 @@ exportHeaderLink.onclick = function() {
toggleConfigSectionDisplay(this, exportContainer);
}
/* Prevent forms from submitting */
function disableFormSubmission() {
let elements = document.querySelectorAll("form");
for (let elem of elements) {
elem.onsubmit = function() {
return false;
}
}
}
/* Load events */
window.addEventListener("load", initBiomeColorSelectors);
@ -2464,3 +2474,4 @@ window.addEventListener("load", updateWidgetStates);
window.addEventListener("load", updateAltitudeText);
window.addEventListener("load", unhideContent);
window.addEventListener("load", fitCanvasInBody);
window.addEventListener("load", disableFormSubmission);