案例 ce-0048 · 场景 scenario-contenteditable-iframe

contenteditable behavior differs when inside an iframe

操作系统: Windows 11 设备: Desktop or Laptop Any 浏览器: Edge 120.0 键盘: US 草稿
iframecontenteditableisolationedge

此页面尚未翻译

目前显示的是英文原文。欢迎您参与翻译工作。

Phenomenon

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.

Reproduction example

  1. Create an iframe.
  2. Inside the iframe, create a contenteditable div.
  3. Try to interact with the contenteditable (type, select, etc.).
  4. Compare the behavior with a contenteditable in the main document.

Observed behavior

  • In Edge on Windows, contenteditable behavior differs inside iframes.
  • Selection may not work correctly.
  • Focus handling may be inconsistent.
  • Events may not bubble correctly.

Expected behavior

  • contenteditable should behave identically whether in the main document or an iframe.
  • Selection and focus should work consistently.
  • Events should behave as expected.

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