Case ce-0082-contenteditable-with-intersection-observer · Scenario scenario-intersection-observer-interference

IntersectionObserver triggers unexpected editor resets

OS: macOS 14.2 Device: Desktop Any Browser: Safari 17.2 Keyboard: US Status: confirmed
intersection-observer composition reset safari

Phenomenon

In Safari, if an IntersectionObserver is watching an editor div, and that div’s intersection ratio changes (even slightly during scrolling or keyboard expansion), the browser may trigger a re-render cycle that clears the current IME composition.

Reproduction Steps

  1. Attach an IntersectionObserver to the editor.
  2. Start an IME composition (e.g., Korean or Japanese).
  3. Scroll the page so the editor’s position moves slightly.
  4. Observe that the current underlined text is immediately committed or deleted.

Observed Behavior

Safari’s “Is visible” check for event dispatching is sensitive to observer cycles, leading to premature compositionend events.

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: macOS 14.2
Device: Desktop Any
Browser: Safari 17.2
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.