Phenomenon
In Chrome on macOS, pressing Enter in a contenteditable region inserts two line breaks (<br> elements) instead of one, causing unexpected spacing between paragraphs.
Reproduction example
- Create a contenteditable div.
- Type some text.
- Press Enter to create a new line.
- Observe the DOM structure.
Observed behavior
- In Chrome on macOS, pressing Enter creates two
<br>elements. - This results in double spacing between lines.
- The behavior is inconsistent with other browsers.
Expected behavior
- Pressing Enter should insert a single line break or create a new paragraph element.
- The spacing should be consistent with standard text editing behavior.