Repository navigation
fix(a11y): show a visible keyboard focus ring on interactive controls - #46396
Merged
sadpandajoe merged 3 commits intoNov 21, 2026
Merged
Conversation
Several focusable controls removed the browser focus outline without replacing it (WCAG 2.4.7): the Filter Badge popover items, the conditional formatting remove button, the viz type gallery categories and thumbnails, and the InfoTooltip trigger, whose &&&:focus rule also overrode AntD v6's own Button focus ring. Give each a :focus-visible outline in colorPrimary, following the HeaderGroupsControl pattern, and drop the InfoTooltip override so AntD's ring shows. The Time range filter's focus ring used the low-alpha controlOutline token, below the 3:1 non-text contrast of WCAG 1.4.11; it uses colorPrimary instead. No global !important :focus-visible rule is added: AntD v6 already draws focus rings on its components, and such a rule would re-add the Filter Badge popover outline removed in #41398 and double-ring AntD Tabs and Select. Supersedes #39242. Co-authored-by: Fedo Hagge-Kubat <fedo.hagge-kubat@aitema.de> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
react-checkbox-tree renders each node title as a focusable span.rct-node-clickable and its stylesheet sets outline: 0 on focus, relying on a background tint that FilterScopeSelector then removes with background: none !important. Keyboard focus on the filter field list and the scope tree was therefore invisible (WCAG 2.4.7). Add a :focus-visible outline in colorPrimary next to that override. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The &:focus > div rule in TimeFilterPlugin matches no element: the filter container's only child is the date-range trigger span, and the keyboard focus target (the date-range button) already shows the browser focus ring. Restore TimeFilterPlugin.tsx and its test to master so the PR no longer touches the Time filter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 task done
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #46396 +/- ##
==========================================
- Coverage 85.66% 85.66% -0.01%
==========================================
Files 3111 3111
Lines 214938 214933 -5
Branches 50908 50907 -1
==========================================
- Hits 184136 184131 -5
Misses 27381 27381
Partials 3421 3421
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aminghadersohi
self-requested a review
November 21, 2026 16:39
aminghadersohi
approved these changes
Nov 21, 2026
aminghadersohi
left a comment
Contributor
There was a problem hiding this comment.
Each new :focus-visible ring matches the element that takes keyboard focus, and each test fails with its rule removed.
sadpandajoe
deleted the
ultraset-visible-keyboard-focus-interactive-elements
branch
November 21, 2026 17:19
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.
SUMMARY
Supersedes #39242.
Keyboard focus is not visible on several interactive controls (WCAG 2.1 SC 2.4.7, Focus Visible). The cause is component CSS that removes the browser's focus outline and puts nothing in its place. No specific introducing change was identified; each of these rules predates the AntD v6 upgrade (#41636).
FiltersBadge/Styles.tsx):FilterItemsetsoutline: none, so arrowing through the applied filters shows no focus. The comment added by fix(dashboard): remove stray focus outline on Filter Badge popover (closes #38789) #41398 already says these items provide their own:focus-visiblestyle; this adds it.ConditionalFormattingControl.tsx):outline: nonewith no replacement.VizTypeGallery.tsx): the category tabs used&:focus { outline: initial }, which resetsoutline-styletonone. The thumbnail buttons usedoutline: none.FilterScopeSelector.tsx, "Set filter mapping"): react-checkbox-tree makes every node title a focusablespan.rct-node-clickable(tabIndex={0}), and its stylesheet setsoutline: 0on focus, relying on a background tint instead. Superset's override then removes that tint (background: none !important), so a focused node shows nothing at all. The override stays, and the node titles get a:focus-visibleoutline.InfoTooltiptrigger:&&&:focus { outline: none }overrode AntD v6's own Button:focus-visiblering. Dropping that one declaration lets AntD's ring show. AntD's base.ant-btn { outline: none }still keeps mouse clicks ring-free.The new rings use the existing local pattern from
HeaderGroupsControl(:focus-visible { outline: 2px solid colorPrimary }). An outline, unlike a box-shadow, also stays visible in Windows High Contrast / forced-colors mode. The ring is inset (-2px) where the parent clips overflow (the Filter Badge popover) or space is tight. It is outset (2px) in the viz gallery, so it stays distinguishable on the primary-filled selected category.Unit tests (
@emotion/jesttoHaveStyleRulewith a:focus-visibletarget) cover the Filter Badge items, the conditional formatting remove button, the viz gallery categories, and the filter scope node titles. TheInfoTooltipand viz-thumbnail changes are styled through Emotion'scssprop. Jest's babel config does not compile that prop (it reaches the DOM as a plain attribute), so those two are verified manually (steps 2 and 4 below).Differences from #39242. This PR leaves out the original's global
:where(...):focus-visible { outline: … !important }rule inGlobalStyles.tsx. Under the AntD v6 upgrade (#41636) that rule is no longer needed, and it is unsafe:.ant-btn:focus { outline: 0 }. It ships.ant-btn { outline: none }plus its own:focus-visibleoutline (genFocusStyle) on Button, Checkbox, Radio, Switch, Tabs, Menu, Dropdown, Pagination and others. Browsers already outline any native element whose author CSS doesn't remove the outline.[tabindex]it matches the Filter Badge popover container (tabIndex={-1},role="menu"). Its!importantwould beat that container'soutline: noneand bring back the stray ring that fix(dashboard): remove stray focus outline on Filter Badge popover (closes #38789) #41398 removed. fix(dashboard): remove stray focus outline on Filter Badge popover (closes #38789) #41398's unit test would stay green, because@emotion/jestcannot see Global styles.[role='tab']sits on.ant-tabs-tab-btn, which AntD deliberately sets tooutline: nonewhile it draws the ring on the parent tab.input/[role='combobox']gets an outline while AntD already outlines the select root via:has(input:focus-visible).outline-offset: 2pxover component rings that need an inset offset (e.g.HeaderGroupsControl). Some of its selectors no longer match anything in v6 (.ant-select-selectorwas renamed.ant-select-content;.ant-cascader-pickerno longer exists).The original's changes to
WithPopoverMenu,RangeFilterPluginanddashboard/styles.tsare also not carried over. TheWithPopoverMenuwrapper is never focused (role="none", notabIndex). The range filter and the dashboardfocusStylealready show a visible ring. InFilterScopeSelector, the original styled the expand/collapse buttons, which already keep the browser's ring. This PR instead adds the ring to the node titles, which had none.The original's
TimeFilterPluginchange (controlOutline→colorPrimaryon a:focus > divtarget) is not carried over either. That selector matches no element in the rendered markup: the filter container's only child is aspan, and the keyboard focus target is the date-range button, which already shows the browser's focus ring. The change would not alter anything on the page.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Keyboard focus (Tab / Shift+Tab) in headless Chromium on SQLite with the examples DB. BEFORE is master @ bb88764; AFTER is this branch.
The Filter Badge popover items and the legacy filter scope tree were not captured (they need an applied filter or
filter_scopesmetadata); the unit tests cover their rules.TESTING INSTRUCTIONS
Use the keyboard only (Tab / Shift+Tab / arrow keys) in a Chromium or Firefox browser:
filter_scopes(legacy filter mapping): Edit dashboard → "…" menu → "Set filter mapping". Tab through the filter field list on the left and the scope tree on the right. Each focused node title shows a primary-color ring.ADDITIONAL INFORMATION
Notes:
InfoTooltipand viz-thumbnail rings have no unit test (Emotion'scssprop is not compiled in jest); they are covered by manual steps 2 and 4.InfoTooltipgets back is AntD's own default focus ring (colorPrimaryBorder). Its contrast against white may be below the 3:1 of WCAG 1.4.11; that is AntD's convention for every button and is left out of scope here..rct-node-clickablemarkup was checked against react-checkbox-tree 1.8.0's source.FilterItemhaspadding: 0, so its inset ring can touch the edge of the icon or text (cosmetic).🤖 Generated with Claude Code