MoonshotAI / MoonshotAI/kimi-code

fix(web): slash menu and mention menu do not close on click outside

Open Beginner friendly
#947 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

Bug description

In the Kimi Web composer, the slash menu (/) and @ mention menu only close when pressing Esc or selecting an item. Clicking outside the menu does not close it, which is inconsistent with standard UI behavior.

Reproduction steps
  1. Open Kimi Web (kimi web or pnpm --filter kimi-web dev)
  2. Open any session
  3. Click the composer input and type /
  4. The slash menu appears
  5. Click on a neutral area outside the menu (e.g., the chat history area)
Expected behavior

The slash menu should close when clicking outside of it.

Actual behavior

The slash menu stays open. Only Esc or selecting a command closes it.

The same issue affects the @ mention menu.

Environment
  • kimi-web version: latest main
  • Browser: Chrome / Chromium / Safari
  • OS: macOS
Additional context

The composer already uses a document click listener to close other dropdowns (e.g., the permission dropdown). The slash and mention menus should follow the same pattern.

I have a local fix and am happy to submit a PR if the team agrees with the direction.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the Kimi Web composer and inspect the existing document click listener used for the permission dropdown. Trace how the slash and mention menus are opened and closed, then make their outside-click behavior match that pattern. Done means clicking a neutral area closes both menus while Esc and item selection still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.