re-add ctrl+enter to submit babycode

This commit is contained in:
2026-06-02 18:31:07 +03:00
parent 7247ac4cf8
commit 93ee829405

View File

@@ -95,3 +95,18 @@
}); });
listsObs.observe(document.body, { childList: true, subtree: true }) listsObs.observe(document.body, { childList: true, subtree: true })
} }
{
// babycode editor: press ctrl+enter to submit
document.querySelectorAll('.babycode-editor').forEach(ta => {
if (ta.form instanceof HTMLFormElement) {
ta.addEventListener('keydown', e => {
if (e.ctrlKey && e.key === 'Enter') {
if (ta.form.reportValidity()) {
ta.form.submit();
}
}
})
}
})
}