Case ce-0023 · Scenario scenario-double-line-break

Pressing Enter inserts two line breaks in contenteditable

OS: macOS Ubuntu 22.04 Device: Desktop or Laptop Any Browser: Chrome 120.0 Keyboard: US Status: draft
line-break enter chrome

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

  1. Create a contenteditable div.
  2. Type some text.
  3. Press Enter to create a new line.
  4. 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.

Browser compatibility matrix

This matrix shows which browser and OS combinations have documented cases for this scenario. The current case is highlighted. Click on a cell to view other cases.

Browser macOS
Chrome
Safari
Current case
Confirmed
Draft
No case documented

All variants (detailed table)

Complete list of all cases for this scenario with full environment details.

Case OS Device Browser Keyboard Status
ce-0003 macOS 14.0 Laptop MacBook Pro Safari 17.0 US draft
ce-0023 macOS Ubuntu 22.04 Desktop or Laptop Any Chrome 120.0 US draft

Playground for this case

Use the reported environment as a reference and record what happens in your environment while interacting with the editable area.

Reported environment
OS: macOS Ubuntu 22.04
Device: Desktop or Laptop Any
Browser: Chrome 120.0
Keyboard: US
Your environment

Use this editable area to reproduce the described case.

Event log
Use this log together with the case description when filing or updating an issue.
0 events
Interact with the editable area to see events here.