contenteditable behavior differs when inside an iframe
OS: Windows 11 · Device: Desktop or Laptop Any · Browser: Edge 120.0 · Keyboard: US
Open case →Scenario
When a contenteditable region is inside an iframe, its behavior may differ from when it's in the main document. Selection, focus, and event handling may be inconsistent.
When a contenteditable region is inside an iframe, its behavior may differ from when it’s in the main document. Selection, focus, and event handling may be inconsistent.
Visual view of how this scenario connects to its concrete cases and environments. Nodes can be dragged and clicked.
Each row is a concrete case for this scenario, with a dedicated document and playground.
| Case | OS | Device | Browser | Keyboard | Status |
|---|---|---|---|---|---|
| ce-0048-contenteditable-in-iframe | Windows 11 | Desktop or Laptop Any | Edge 120.0 | US | draft |
Open a case to see the detailed description and its dedicated playground.
OS: Windows 11 · Device: Desktop or Laptop Any · Browser: Edge 120.0 · Keyboard: US
Open case →Other scenarios that share similar tags or category.
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.
When a contenteditable region is inside a table cell (`<td>`), editing the content may cause layout issues in Firefox. The table may resize unexpectedly or the cell may overflow.
When a contenteditable element is inside a cross-origin iframe, CORS restrictions may prevent certain operations. Accessing the contenteditable from the parent frame may be blocked, and some editing operations may be restricted.
When a contenteditable element has CSS transforms applied (translate, scale, rotate), the selection handles and caret may appear in incorrect positions. The visual position may not match the actual selection position.
When contenteditable elements are inside an iframe with the sandbox attribute, their behavior may be restricted or broken depending on which sandbox tokens are enabled. Without allow-scripts or allow-same-origin, many contenteditable features (like rich text editing, clipboard access, or event handling) may not work properly.
Have questions, suggestions, or want to share your experience? Join the discussion below.