Use submitThisForm() only if there is no 'data-on-change' == 'submitThisForm' attribute (skin.js)

- We need to find the 'data-on-change' attribute either on the current "target" object or, when using "chosen", on the source object from which the "chosen" element was created.
If there is no attribute (for example for text fields), then we execute submitThisForm()
This commit is contained in:
IgorA100
2025-08-23 18:40:36 +03:00
committed by GitHub
parent 02c481a05b
commit 4dd30f58e2

View File

@@ -1792,7 +1792,15 @@ function handleKeydownGeneral(evt) {
// Controls pressing "Enter" inside the sliding panel from Sidebar. Used to submit the form to the Console page.
if (navbar_type == 'left' && key == 'Enter') {
if (SIDEBAR_MAIN_EXTRUDER.contains(target)) {
//submitThisForm();
if (target.getAttribute('data-on-change')) {
return;
} else {
const chosenContainer = target.closest('.chosen-container');
if (chosenContainer && chosenContainer.previousElementSibling.getAttribute('data-on-change') == 'submitThisForm') {
return;
}
}
submitThisForm();
}
}
}