Skip to content

Conversation

@Raviguntakala
Copy link
Contributor

@Raviguntakala Raviguntakala commented Dec 23, 2025

Problem

When typing / or @, autocomplete shows suggestions.
If you press space by mistake, the dropdown closes.
When you press backspace to remove the space, autocomplete does not come back, even though the text is valid again.

Steps to Reproduce

  1. Type /something → autocomplete appears
  2. Press space → autocomplete closes
  3. Press backspace → autocomplete does not reopen

Fix

Updated the onInput logic to reopen autocomplete when the cursor is back in a valid position.

  • For /
    Autocomplete reopens when the text starts with / and there is no space before the cursor

  • For @
    Finds the closest @ before the cursor and reopens autocomplete if there is no space between @ and the cursor

Testing

  • /something → space → backspace → autocomplete reopens
  • @agent → space → backspace → autocomplete reopens
  • Normal behavior is unchanged
  • Text like test/path does not trigger / autocomplete
Screen.Recording.2025-12-23.at.6.31.46.PM.mov
Screen.Recording.2025-12-23.at.6.33.38.PM.mov

@Raviguntakala Raviguntakala force-pushed the fix/autocomplete-reopen-on-backspace branch from b417245 to 7b4f1f0 Compare December 23, 2025 11:55
@Raviguntakala
Copy link
Contributor Author

Hey @rekram1-node , just a quick ping to check this PR when you have time. Thanks!

@kommander
Copy link
Collaborator

Does it work with CJK characters before and in the @ part?

@Raviguntakala
Copy link
Contributor Author

Raviguntakala commented Jan 9, 2026

Does it work with CJK characters before and in the @ part?

Yes, I tested with CJK characters before and in the @ trigger. Autocomplete opens correctly, cursor positioning is fine, and behavior is consistent.

The screenshots show:

1.你好 @ (Chinese: "Hello @")
image
2.こんにちは@ (Japanese: "Hello @")
image
3.你好 @to (Chinese text before @, then filtering)
image
4.안녕하세요 @file (Korean: "Hello @file")
image
5.test 你好 @ (English + Chinese mixed)
image

@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@rekram1-node
Copy link
Collaborator

/review

@github-actions
Copy link
Contributor

lgtm

@rekram1-node rekram1-node merged commit 22c68a6 into anomalyco:dev Jan 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants