#5931·slate

Windows text suggestions append instead of replace in Slate editor

Author: AtronyCreated Aug 8, 2025Updated Mar 5, 2026
Labelsbug⚑ cross platform

Description On Windows, Slate editors don’t handle the OS/browser text suggestions correctly. When accepting a suggested completion, Slate inserts the entire suggestion without replacing the already-typed prefix. Example: type He, click the suggestion Hello → the editor shows HeHello instead of Hello.

Steps To reproduce the behavior:

  1. Enable Windows “Text suggestions” feature (instructions: Enable text suggestions in Windows).
  2. Open the sandbox in Windows.
  3. Focus the Slate editor and type a partial word, e.g., He.
  4. When the OS/browser shows a suggestion (e.g., Hello), click the suggestion with the mouse (or tap it on the suggestion bar).

Observe: the accepted suggestion is appended after the typed prefix → HeHello. Expectation Accepting an autocomplete suggestion should replace the current word’s prefix, yielding Hello in the example above, consistent with editors like Google Docs, Notion, and Medium.

Environment

  • Slate Version: 0.111.0 (latest)
  • Operating System: Windows 11 Pro, Version 23H2 (Build 22631)
  • Browser: Google Chrome 127.0.6533.120 (64-bit)
  • Input method: Hardware keyboard with Windows text suggestions enabled

Context Likely related to how Slate handles composition or beforeinput events when the suggestion is inserted by the OS/browser. It may not be recognizing that the suggestion should replace the composing range rather than append at the caret.