Case ce-0151-list-item-empty-after-delete · Scenario scenario-list-item-deletion

Empty list items remain after deleting all text in Safari

OS: Windows 11 Device: Desktop or Laptop Any Browser: Safari 17.0 Keyboard: US Status: draft
list empty deletion safari

Phenomenon

When deleting all text from a list item in Safari, empty list items may remain in the DOM. These empty <li> elements cause layout issues and make the list structure confusing.

Reproduction example

  1. Create a list: <ul><li>Item 1</li><li>Item 2</li></ul>
  2. Delete all text from “Item 2”
  3. Observe the DOM

Observed behavior

  • Empty <li></li> or <li><br></li> elements remain
  • List structure includes empty items
  • Layout has unexpected spacing
  • Empty items are visible

Expected behavior

  • Empty list items should be removed
  • Or at least one empty item should remain for cursor
  • List structure should be clean
  • No unnecessary empty items

Browser Comparison

  • Chrome/Edge: May remove empty items or leave one
  • Firefox: More likely to leave empty items
  • Safari: Most likely to leave empty items (this case)

Notes and possible direction for workarounds

  • Clean up empty list items after deletion
  • Remove empty items but preserve list structure
  • Keep one empty item if needed for cursor
  • Normalize list structure regularly
Before
  • Item 1
  • Item 2
List structure
After Delete (Bug)
  • Item 1
After deleting Item 2 text, empty &lt;li&gt; element remains
vs
✅ Expected
  • Item 1
Expected: Empty list item removed, clean list structure

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-0097-list-item-deletion-chrome Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0098-list-item-deletion-firefox Windows 11 Desktop or Laptop Any Firefox 120.0 US draft
ce-0151-list-item-empty-after-delete Windows 11 Desktop or Laptop Any Safari 17.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: Safari 17.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.