Case ce-0127-empty-paragraph-after-delete · Scenario scenario-empty-element-cleanup

Empty paragraphs accumulate after deleting all text

OS: Windows 11 Device: Desktop or Laptop Any Browser: Chrome 120.0 Keyboard: US Status: draft
empty paragraph cleanup chrome

Phenomenon

When deleting all text from a paragraph in Chrome, empty paragraph elements with only <br> tags accumulate in the DOM. These empty paragraphs cause unnecessary spacing and bloat the HTML.

Reproduction example

  1. Create multiple paragraphs with text
  2. Delete all text from each paragraph
  3. Observe the DOM structure

Observed behavior

  • Empty <p><br></p> elements remain
  • Multiple empty paragraphs accumulate
  • DOM becomes bloated
  • Unnecessary spacing appears

Expected behavior

  • Empty paragraphs should be cleaned up
  • Or at least one empty paragraph should remain for cursor
  • DOM should be minimal
  • No unnecessary spacing

Browser Comparison

  • Chrome/Edge: Leaves empty paragraphs (this case)
  • Firefox: More likely to leave empty elements
  • Safari: Most likely to accumulate empty elements

Notes and possible direction for workarounds

  • Clean up empty paragraphs after deletion
  • Keep only one empty paragraph for cursor placement
  • Remove empty paragraphs that are not needed
  • Normalize DOM structure regularly
Before

Text 1

Text 2

Text 3

Text with multiple paragraphs
After Delete All (Bug)




After deleting all text, empty paragraphs (&lt;br&gt; included) accumulate
vs
✅ Expected


Expected: Only one empty paragraph maintained for cursor placement

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.

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-0111-empty-elements-accumulate Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0127-empty-paragraph-after-delete Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0140-empty-span-style-attributes Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0159-empty-elements-after-format-remove Windows 11 Desktop or Laptop Any Safari 17.0 US draft
ce-0174-empty-div-after-list-removal Windows 11 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: Windows 11
Device: Desktop or Laptop Any
Browser: Chrome 120.0
Keyboard: US
Your environment
Sample HTML:
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.

Comments & Discussion

Have questions, suggestions, or want to share your experience? Join the discussion below.