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
- Attach an
IntersectionObserverto the editor. - Start an IME composition (e.g., Korean or Japanese).
- Scroll the page so the editor’s position moves slightly.
- 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.