Skip to content

Type Ahead: Suggestion restarts immediately after Escape dismissal #839

Description

@yogeshbhutkar

Description

When a type-ahead suggestion is visible, pressing Escape correctly dismisses the ghost text and reflects the user’s intent to reject the suggestion. However, if the caret is at the end of the block, the Escape keyup immediately restarts the caret-driven suggestion flow and triggers another network request.

This creates unnecessary requests and causes the dismissed suggestion flow to restart without new user input. Pressing Escape should only dismiss the current suggestion. A new suggestion should not be requested on pressing Escape until the user shows renewed writing intent, such as by typing a character.

Step-by-step reproduction instructions

  1. Enable the Type-ahead Text experiment.
  2. Create or edit a post.
  3. Start typing in a supported block and wait for a type-ahead suggestion to appear.
  4. Press Escape to dismiss the suggestion.
  5. Observe that the current suggestion is dismissed, but a new suggestion is immediately requested and shown again.

Screenshots, screen recording, code snippet

bug.mov

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except the AI plugin.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

Labels

[Type] BugSomething isn't working

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions