disable enter key submission on grapesjs editor

This commit is contained in:
Simon Vieille 2022-05-05 16:22:27 +02:00
parent 7fa7d10b01
commit 75e3cf41f6
Signed by: deblan
GPG key ID: 579388D585F70417

View file

@ -139,6 +139,14 @@ const doInitEditor = () => {
} catch (e) {
editor.loadData({ html: '' })
}
$(element).parents('form').keypress((e) => {
if ($(e.target).parents('#' + id).length === 0) {
return true;
}
return (e.keyCode || e.which || e.charCode || 0) !== 13
})
})
}