Skip to content

Bug/gap 2764 wcag keyboard navigation fix#494

Merged
faisalshehzad-goaco merged 2 commits into
bug/GAP-2763_WCAG-Fixesfrom
bug/GAP-2764_WCAG-Keyboard-Navigation-Fix
Jul 17, 2026
Merged

Bug/gap 2764 wcag keyboard navigation fix#494
faisalshehzad-goaco merged 2 commits into
bug/GAP-2763_WCAG-Fixesfrom
bug/GAP-2764_WCAG-Keyboard-Navigation-Fix

Conversation

@faisalshehzad-goaco

Copy link
Copy Markdown
Collaborator

No description provided.

// and re-asserts it via a MutationObserver whenever TinyMCE resets it. Arrow
// key navigation across the single toolbar group is left to TinyMCE, so its
// own group attributes are deliberately not touched.
const makeToolbarKeyboardAccessible = (

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makeToolbarKeyboardAccessible is long and handles multiple responsibilities; split into smaller functions (e.g., button management, observer setup, event handlers) to improve readability and maintainability.

Details

✨ AI Reasoning
​1. The changes introduced a new helper function that sets up accessibility behavior for the TinyMCE toolbar. 2. The function contains several distinct responsibilities: locating toolbar DOM, managing tabindex state across buttons, creating and wiring a MutationObserver, registering focusin and keydown handlers, and setting iframe title. 3. These responsibilities increase cognitive load when reading the function because a reviewer must understand DOM mutation handling, event handling, and focus logic in one place. 4. The added onInit hookup and accessibleName constant also tie into this helper, further coupling behavior. 5. Breaking this into smaller, well-named helper functions would make the behavior easier to reason about and test.

🔧 How do I fix it?
Break down long functions into smaller helper functions. Aim for functions under 60 lines with fewer than 10 local variables.

Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

@faisalshehzad-goaco
faisalshehzad-goaco merged commit 373c6c6 into bug/GAP-2763_WCAG-Fixes Jul 17, 2026
7 checks passed
@faisalshehzad-goaco
faisalshehzad-goaco deleted the bug/GAP-2764_WCAG-Keyboard-Navigation-Fix branch July 17, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant