Skip to content

Enabling autocorrect in MacOS with text replacements accepts replacements with any key press #1579

@Monkatraz

Description

@Monkatraz

Describe the issue

If you use the Text Replacements feature in MacOS and enable autocorrect in the editor through an extension, typing a valid text to replace candidate has the suggested replacement apply on any key press, not just pressing space, enter or punctuation. It also doesn't seem to use the right cursor placement after the suggestion is accepted.

In this video, I have two text replacements, i -> I and omw -> On my way! (latter is stock in MacOS).

Screen.Recording.2025-06-25.at.4.58.15.PM.mov

What's supposed to happen is that if you type a valid candidate and you will get a tooltip for showing the replacement, and entering whitespace or punctuation after the word will automatically accept it. Typing anything else discards the replacement.

This has caused issues for some users on Replit - we use CodeMirror for one of our input boxes since we need things like decorations and change sets.

Browser and platform

MacOS, Chrome

Reproduction link

https://codemirror.net/try/#c=aW1wb3J0IHttaW5pbWFsU2V0dXAsIEVkaXRvclZpZXd9IGZyb20gImNvZGVtaXJyb3IiCgpjb25zdCBlbmFibGVBdXRvQ29ycmVjdCA9IEVkaXRvclZpZXcuY29udGVudEF0dHJpYnV0ZXMub2YoewogIGF1dG9jb3JyZWN0OiAnb24nCn0pCgpuZXcgRWRpdG9yVmlldyh7CiAgZG9jOiAiLi4uIiwKICBleHRlbnNpb25zOiBbCiAgICBtaW5pbWFsU2V0dXAsCiAgICBlbmFibGVBdXRvQ29ycmVjdCwKICBdLAogIHBhcmVudDogZG9jdW1lbnQuYm9keQp9KQo=

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions