Skip to content

Bug: Tab does not accept the highlighted @ mention suggestion in collaborative chat #1299

Description

@paullizer

Issue

In multi-user (collaborative) conversations, the @ mention autocomplete menu in the chat composer does not accept the highlighted suggestion when the user presses Tab. Tab instead falls through to the browser default and moves focus out of the message box, so the partially typed @name text is left behind.

Most users expect Tab to complete an autocomplete entry. This is also inconsistent with the agent-instruction mention menu elsewhere in the app (static/js/agent_instruction_mentions.js), which already treats Tab and Enter the same way.

Steps to Reproduce

  1. Open a shared / collaborative conversation on /chats.
  2. Click into the message box and type @.
  3. The participant / agent suggestion menu (#collaboration-mention-menu) opens with the first entry highlighted.
  4. Optionally type a few characters of a name, or use the arrow keys to move the highlight.
  5. Press Tab.

Expected Behavior

Tab accepts the highlighted suggestion exactly like Enter does today, inserting the mention into the composer and keeping focus in the message box.

Actual Behavior

Tab does nothing to the menu. Focus moves to the next control in the page, the mention menu closes on blur, and the raw @par text remains in the composer. Only Enter accepts a suggestion.

Impact

Minor UX friction for every user of shared conversations. There is a workaround (press Enter), so this is not blocking, but it breaks a very common typing habit and makes the composer feel inconsistent with the rest of the app.

Notes

Suspected area:

  • application/single_app/static/js/chat/chat-collaboration.jshandleComposerKeydown() handles ArrowDown, ArrowUp, Enter, and Escape, but has no Tab branch.
  • application/single_app/static/js/chat/chat-messages.js — the #user-input keydown listener delegates to window.chatCollaboration.handleComposerKeydown(e) and returns early when it returns true.
  • application/single_app/static/js/agent_instruction_mentions.js — reference implementation that already handles case 'Tab': case 'Enter': together.

Agreed behavior:

  • Plain Tab accepts the highlighted suggestion (participant tag, agent/model ai_tag, or the invite-confirmation flow, matching Enter).
  • Shift+Tab is left alone so normal focus-backwards behavior still works.
  • Tab in the "No matching participants..." empty state also falls through to normal focus movement.

Related accessibility gap found in the same code: #collaboration-mention-menu is declared role="listbox" in templates/chats.html, but the suggestion items rendered by renderMentionMenu() are plain buttons with no role="option" / aria-selected, so assistive tech cannot announce which suggestion is highlighted during keyboard navigation. This will be fixed alongside the Tab support.

Related but not duplicates — both concern which suggestions appear rather than keyboard selection:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions