Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit a0feb63

Browse files
Zyntondmo-odoo
authored andcommitted
[FIX] EventNormalizer: consistently apply insertLineBreak on shift+enter
Prior to this fix, there were certain situations where doing shift+enter was triggering an insertParagraph action instead of insertLineBreak. The reason was that in those situations, the browser was actually giving an insertText input type together with the "Enter" key, for some reason... Steps to reproduce the fixed issue: - open example Note "Project N.947.5" in Odoo - add: Enter - couple of characters - Enter - couple of characters - make the last line blockquote - at the end of the last line, add: Shift+enter - couple of characters - Shift+enter at this point broke the blockquote.
1 parent 454d997 commit a0feb63

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/plugin-dom-editable/src/EventNormalizer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,7 @@ export class EventNormalizer {
836836
(cutEvent && 'deleteByCut') ||
837837
(dropEvent && 'insertFromDrop') ||
838838
(pasteEvent && 'insertFromPaste') ||
839+
(key === 'Enter' && inputEvent?.inputType === 'insertText' && 'insertLineBreak') ||
839840
(inputEvent && inputEvent.inputType);
840841

841842
// In case of accent inserted from a Mac, check that the char before was

0 commit comments

Comments
 (0)