Skip to content

Bug: pressing space to accept a macOS text replacement leaves the caret before the space #8413

@nmggithub

Description

@nmggithub

Lexical version: commit 4a43cb027f55718d6d32cc7fb8e7ec31adf59d2e

Steps To Reproduce

  1. Type a macOS text replacement and press space.

Link to code example:

Screen.Recording.2026-04-28.at.14.11.05.mov

The current behavior

The caret ends up before the space.

The expected behavior

The caret ends up after the space.

Impact of fix

This happens for every macOS text replacement. This behavior does not match expectations, leading to users who type fast missing spaces (or, rather, typing before them). This is arguably the fault of how Chrome and Firefox fire the Space beforeinput event before the replacement event (Safari doesn't, so it's fine).

Metadata

Metadata

Assignees

No one assigned

    Labels

    compositionRelating to IME inputs

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions