Phenomenon
When a contenteditable region is inside a Shadow DOM, its behavior may be broken or inconsistent. Selection, focus, and editing may not work as expected.
Reproduction example
- Create a custom element with Shadow DOM.
- Inside the Shadow DOM, create a contenteditable div.
- Try to interact with the contenteditable (type, select, etc.).
- Observe the behavior.
Observed behavior
- In Chrome on macOS, contenteditable may not work correctly inside Shadow DOM.
- Selection may be broken.
- Focus may not work.
- Events may not fire correctly.
Expected behavior
- contenteditable should work correctly inside Shadow DOM.
- Selection and focus should work as expected.
- Events should fire and bubble correctly.