Case ce-0040 · Scenario scenario-contenteditable-readonly

contenteditable="false" on child elements is not respected consistently

OS: Any Ubuntu 22.04 Device: Desktop or Laptop Any Browser: Chrome 120.0 Keyboard: US Status: draft
readonly nested contenteditable chrome

Phenomenon

When a contenteditable region contains child elements with contenteditable="false", the behavior is inconsistent. Some browsers allow editing within these elements, while others correctly prevent it.

Reproduction example

  1. Create a contenteditable div.
  2. Inside it, add a child element with contenteditable="false":
    <div contenteditable="true">
      <p>Editable text</p>
      <p contenteditable="false">This should not be editable</p>
    </div>
  3. Try to edit the text in the child element with contenteditable="false".
  4. Observe whether editing is prevented.

Observed behavior

  • In Chrome, child elements with contenteditable="false" may still be editable.
  • The attribute is not consistently respected.
  • Selection and editing may work within elements that should be read-only.

Expected behavior

  • Elements with contenteditable="false" should not be editable.
  • The attribute should be respected regardless of parent element state.
  • Selection within read-only elements should be allowed, but editing should be prevented.

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: Any 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.