Skip to content

CODAP-1341: suppress focus outline on CFM menu list container - #430

Merged
kswenson merged 1 commit into
v2.2.xfrom
codap-1341-menu-focus-outline
May 21, 2026
Merged

CODAP-1341: suppress focus outline on CFM menu list container#430
kswenson merged 1 commit into
v2.2.xfrom
codap-1341-menu-focus-outline

Conversation

@kswenson

Copy link
Copy Markdown
Member

Summary

Suppresses the browser's default focus outline on the CFM menu list container (.menu-list-container).

React Aria gives .menu-list-container programmatic keyboard focus when a menu (File, Settings, Help, …) opens. The browser's :focus-visible heuristic resolves that focus inconsistently, and when it resolves true the browser draws its default focus outline around the whole menu container. The container is never a meaningful keyboard focus target — keyboard users navigate the menu items, which carry their own :focus-visible outline — so this adds a rule to remove the outline on the container itself.

Relationship to CODAP PR #2585

CODAP PR #2585 fixes two CFM-menu symptoms that share a root cause:

  • Missing drop shadow — caused by a CODAP-specific global box-shadow reset (*:focus:not(:focus-visible) { box-shadow: none !important }). That rule lives only in CODAP, so that fix correctly belongs in CODAP.
  • Stray focus outlinenot caused by CODAP's reset (which only touches box-shadow, never outline). It is the browser's default UA focus ring on the programmatically-focused container, and it appears in any host app embedding the CFM.

This PR addresses the second symptom in the CFM, where it belongs. CFM previously had no outline rule on .menu-list-container at all. Once this ships, the matching .menu-list-container:focus { outline: none } rule in CODAP PR #2585 becomes redundant (the box-shadow exclusion still needs to stay in CODAP).

Changes

src/style/components/dropdown-menu.styl:

  • Add a top-level .menu-list-container:focus { outline: none } rule, so it covers both the main menu and submenu containers.

Testing

CSS-only change; production build compiles and the rule is present in the emitted app.css. No automated test added (consistent with CODAP PR #2585).

Relates to CODAP-1341. This PR targets v2.2.x; it can be cherry-picked to master later.

🤖 Generated with Claude Code

React Aria gives the menu list container (.menu-list-container)
programmatic keyboard focus when a menu opens. The browser's
:focus-visible heuristic resolves that focus inconsistently, and
when it resolves true the browser draws its default focus outline
around the whole menu container.

The container is never a meaningful keyboard focus target -- keyboard
users navigate the menu items, which carry their own :focus-visible
outline -- so suppress the outline on the container itself.

This is the CFM-side counterpart to CODAP PR #2585. That PR fixes the
menu drop shadow, which is broken by a CODAP-specific global box-shadow
reset and so must be fixed in CODAP. The stray focus outline, however,
is a CFM rendering artifact that appears in any host app, so the CFM
should own it. Once this ships, the matching outline rule in CODAP
PR #2585 becomes redundant.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@emcelroy emcelroy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good 👍

@kswenson
kswenson merged commit 1cced6c into v2.2.x May 21, 2026
2 checks passed
@kswenson
kswenson deleted the codap-1341-menu-focus-outline branch May 21, 2026 18:03
kswenson added a commit that referenced this pull request Aug 27, 2026
…rt-focus-outline

CODAP-1341: suppress focus outline on CFM menu list container (forward-port of #430)
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.

2 participants