Case ce-0087 · Scenario scenario-page-visibility-api

Page Visibility API may affect contenteditable during tab switches

OS: macOS 14.0 Device: Desktop or Laptop MacBook Pro Browser: Safari 17.0 Keyboard: US Status: draft
page-visibility-api focus safari macos

Phenomenon

When a page with a contenteditable element becomes hidden (tab switch, minimize), the Page Visibility API may affect editing state. Focus may be lost, and composition may be interrupted.

Reproduction example

  1. Create a contenteditable div with active composition (IME).
  2. Switch to another tab or minimize the window.
  3. Switch back to the original tab.
  4. Observe whether composition continues or is interrupted.
  5. Check if focus is maintained.

Observed behavior

  • In Safari on macOS, tab switches may interrupt composition.
  • Focus may be lost when the page becomes hidden.
  • Composition state may not be preserved.
  • Editing may be disrupted.

Expected behavior

  • Composition should pause gracefully when the page is hidden.
  • Focus should be restored when the page becomes visible.
  • Editing state should be preserved across visibility changes.

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.0
Device: Desktop or Laptop MacBook Pro
Browser: Safari 17.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.