Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves keyboard accessibility across the editor toolbar to address #586 by introducing roving tabindex navigation and improving focus/escape handling for toolbar popups and dropdowns.
Changes:
- Implement roving tabindex for toolbar items with ArrowLeft/ArrowRight/Home/End navigation and Shift+Tab support from the editor back into the toolbar.
- Improve keyboard activation of toggle/insert toolbar buttons by preventing event leakage to the editor and restoring focus to the editor after execution.
- Add Escape-to-close behavior and
rolesemantics for link/image/color-picker popups, plus improved keyboard navigation and focus management for the heading dropdown.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| projects/ngx-editor/src/lib/modules/menu/toggle-command/toggle-command.component.ts | Prevent default on Enter/Space and restore focus to editor after toggling. |
| projects/ngx-editor/src/lib/modules/menu/toggle-command/toggle-command.component.html | Pass keyboard event through to the handler for Enter/Space. |
| projects/ngx-editor/src/lib/modules/menu/insert-command/insert-command.component.ts | Prevent default on Enter/Space and restore focus to editor after inserting. |
| projects/ngx-editor/src/lib/modules/menu/insert-command/insert-command.component.html | Pass keyboard event through to the handler for Enter/Space. |
| projects/ngx-editor/src/lib/modules/menu/menu.component.ts | Add roving tabindex logic, mutation observer updates, and Shift+Tab interception from editor to toolbar. |
| projects/ngx-editor/src/lib/modules/menu/menu.component.html | Add role="toolbar" to the menubar container. |
| projects/ngx-editor/src/lib/modules/menu/link/link.component.ts | Add Escape-to-close and optional focus restoration to the trigger. |
| projects/ngx-editor/src/lib/modules/menu/link/link.component.html | Mark popup as a dialog via role="dialog". |
| projects/ngx-editor/src/lib/modules/menu/image/image.component.ts | Add Escape-to-close and optional focus restoration to the trigger. |
| projects/ngx-editor/src/lib/modules/menu/image/image.component.html | Mark popup as a dialog via role="dialog". |
| projects/ngx-editor/src/lib/modules/menu/dropdown/dropdown.component.ts | Add keyboard navigation within dropdown, focus-on-open behavior, and Escape-to-close with focus restoration. |
| projects/ngx-editor/src/lib/modules/menu/dropdown/dropdown.component.html | Wire new keydown handlers, add disabled binding for items, and make listbox container keydown-aware. |
| projects/ngx-editor/src/lib/modules/menu/color-picker/color-picker.component.ts | Add Escape-to-close and optional focus restoration to the trigger. |
| projects/ngx-editor/src/lib/modules/menu/color-picker/color-picker.component.html | Mark popup as a dialog via role="dialog". |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add aria-label to toolbar and link/image/color dialogs so screen readers can announce them. - focusActiveItem: return false when no enabled item can be focused, so the editor's Shift+Tab handler doesn't trap focus when the toolbar is fully disabled. - Dropdown Tab: move focus to the trigger before closing so the browser's tab navigation has a stable anchor. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 12, 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.
This PR fixes sibiraj-s/ngx-editor#586 and some other keyboard accessibility issues found while testing the fix.
This fixes it by implementing a "roving tabindex" accessibility pattern, where the entire toolbar is one focus target, but that the selected focus target can change based on keyboard left/right/home/end navigation.
This also fixes some issues like the link/image dialogs not closing with pressing escape, not being able to use keyboard navigation to select heading sizes, etc.