Case ce-0146-background-color-persistence · Scenario scenario-background-color-change

Background color does not persist when typing after applying

OS: Windows 11 Device: Desktop or Laptop Any Browser: Chrome 120.0 Keyboard: US Status: draft
color background persistence chrome

Phenomenon

When applying a background color to selected text in Chrome and then continuing to type, the new text does not inherit the background color. The background formatting is lost for newly typed characters.

Reproduction example

  1. Select some text in a contenteditable element
  2. Apply a background color (e.g., yellow highlight)
  3. Place cursor after the highlighted text
  4. Type new text

Observed behavior

  • The newly typed text does not have background color
  • Background formatting is not maintained for new text
  • This differs from text color which may persist
  • User must reapply background for each new text segment

Expected behavior

  • Newly typed text should inherit background color
  • Or behavior should be consistent with text color
  • Background formatting should persist until explicitly changed
  • Behavior should be predictable

Browser Comparison

  • Chrome/Edge: Background does not persist (this case)
  • Firefox: Similar behavior
  • Safari: Background persistence varies

Notes and possible direction for workarounds

  • Intercept text insertion and apply background color
  • Use beforeinput event to detect text insertion
  • Apply background style to newly inserted text
  • Maintain background color state for current typing position
Before
Hello World
Basic text
After Background Color
Hello World
Background color applied (yellow)
vs
✅ Expected
Hello World New
Expected: Newly typed text also inherits background color

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-0121-background-color-selection-issue Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0146-background-color-persistence Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0167-background-color-format-variation 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.