You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Arrowing onto a /command, @file or #12 in a composer draft opens its suggestion list, which then takes the arrow keys and Enter #36487
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
Open a thread in the web client and focus the composer.
Type /mod ab. The command list opens while /mod is typed and closes at the space.
Press ArrowLeft three times, so the caret sits right after /mod.
Press ArrowDown, then type !.
Clear the draft, repeat steps 2 and 3, then press Shift+Enter.
Expected behavior
The list stays closed after step 3, because nothing in /mod was edited. ArrowDown moves the caret, so the draft reads /mod ab!. Shift+Enter adds a new line after /mod.
Actual behavior
At step 3 the command list opens again, and the editor's aria-activedescendant points at its first option. The open list then takes ArrowUp, ArrowDown, Enter and Tab from the text:
Step 4: ArrowDown goes to the list, the caret stays put, and the draft reads /mod! ab.
Step 5: Shift+Enter picks the highlighted command. /mod is removed from the draft, leaving ab.
So arrowing through a message that is already written can end in a list nobody asked for, and Enter can replace a word with the highlighted suggestion instead of adding a line or sending.
It is worse with a screen reader. Since #10154 the open list sets aria-activedescendant on the editor, so each time the caret crosses one of these words the list is announced and the reading position in the text is lost.
The same code handles $skill, @file and #12. I confirmed those in a unit test of the trigger logic and by reading the code, not in the app.
Cause. The editor reports caret moves and edits through the same change callback, and the composer looks for a trigger at the caret on every call. The key handler then treats any trigger at the caret as an open menu.
Windows 11, headless Chromium through Playwright 1.64.1, web client from vp run dev. The desktop app wraps the same composer and was not tested. Mobile is not affected: its suggestion popover takes no keys. Screen reader speech on main was not recorded.
Logs or stack traces
No response
Screenshots, recordings, or supporting files
The composer after step 3 with /model ab as the draft: the command list is open although the caret was only moved.
Workaround
Press Escape when the list opens. It stays closed while the caret is in that word.
Activity