Repository navigation
Make icon buttons and menu toggles reachable and usable with the keyboard - #5683
Merged
freescout-help-desk merged 1 commit intoSep 30, 2026
Conversation
…oard The conversation toolbar icons (Reply, Note, Delete, More Actions), the star in the conversation and in the list, each thread's options menu and the mailbox and user sidebar menus are span/i elements with role="button" (or no role) and no tabindex, so Tab skips them and Enter or Space does nothing. Add tabindex="0" (only where the menu is rendered, so there are no empty Tab stops) and a delegated keydown handler that clicks role="button" spans and icons on Enter and Space, ignoring key repeat. Space on a dropdown toggle is left to Bootstrap, which already opens it.
This was referenced Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #1150
Problem
In the conversation view, most of the icon buttons can't be reached with Tab, and can't be pressed with Enter or Space. The toolbar icons are rendered as spans with
role="button"and anaria-label, but notabindex:A
spanis not focusable by default, so Tab skips it. The markup says "button" to screen readers, but a keyboard user can't reach it or press it. Even with focus, Enter does nothing, because no key handler is attached. Only the click handler is.The same applies to:
resources/views/conversations/view.blade.php)<i>with a click handler, no role)resources/views/conversations/partials/thread.blade.php)mailboxes/sidebar_menu.blade.php,users/sidebar_menu.blade.php)To reproduce: open any conversation and press Tab repeatedly. After the mailbox menu, focus goes from "New Conversation" straight to the Assignee and Status buttons. Reply, Note, Delete and More Actions are skipped, and so is the star.
I noticed this while working through a backlog of emails from the keyboard. Every delete needs the mouse.
Fix
tabindex="0"to those elements (androle="button"to the stars), so they join the Tab order where they sit on the page. The thread options and sidebar toggles get it under the same condition that renders their menu (isAdmin()for line-item threads,count($menu_mailboxes),count($users)), so there is no Tab stop that opens nothing.keydownhandler inmain.js, next to the other global handlers, which clicks a focusedspan/iwithrole="button"on Enter or Space, the way a native button behaves:Key repeat is ignored, so holding Enter on a star sends one request, not one per repeat. Space on a dropdown toggle is left alone, because Bootstrap's dropdown keydown handler already opens the menu on Space. Handling it here as well would open and immediately close it. Enter is not handled by Bootstrap, so it goes through
.click()like the other elements, and then the arrow keys move through the menu as usual.The selector only matches elements that have both
role="button"and atabindex, so nothing else on the page changes behaviour. Existing click handlers are reused, so each action does exactly what a mouse click does.Not changed
<b class="caret"></b>). A screen reader announces it as "button". Anaria-labelwould need a string, so I left that for you to decide.@action('conversation.action_buttons')are not changed. If a module renders aspan/iwithrole="button"andtabindex, it now also responds to Enter and Space. I found no such element in core.aria-pressed), and theirtitleisn't updated after toggling. That is a screen-reader improvement beyond keyboard access, so I left it out.style.cssdoesn't suppress it for these elements.Tested
On
masterat 929c575, PHP 8.2, MariaDB 11, Chrome, with real key events (CDPInput.dispatchKeyEvent), not synthetic JS events:star_conversationrequest.isAdmin()condition the non-admin line-item toggle becomes an empty Tab stop.Files
public/js/main.js: keydown handlerresources/views/conversations/view.blade.php: toolbar icons, More Actions, starresources/views/conversations/conversations_table.blade.php: list stars (both occurrences)resources/views/conversations/partials/thread.blade.php: thread options (both occurrences)resources/views/mailboxes/sidebar_menu.blade.php,resources/views/users/sidebar_menu.blade.php: sidebar menus