Skip to content

Commit

Permalink
Prevent "p" insertion by shift-enter in singleline editables (regress…
Browse files Browse the repository at this point in the history
…ion)

Fix #677
  • Loading branch information
bago committed Mar 1, 2023
1 parent ad4a7aa commit 4d8908b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/js/bindings/wysiwygs.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,15 @@ ko.bindingHandlers.wysiwyg = {
});
}
*/
// 20230301: since we moved to "div" editing the shift-enter will add "p"s.
if (!fullEditor) {
editor.on('keydown', function(e) {
if (e.shiftKey && (e.which === 13 || e.keyCode === 13)) {
// e.preventDefault();
tinymce.dom.Event.cancel(e);
}
});
}

// Tinymce doesn't catch exceptions, let's wrap the fire.
if (typeof editor.originalFire == 'undefined') {
Expand Down

0 comments on commit 4d8908b

Please sign in to comment.