Skip to content

fix: improve popup accessibility semantics#72

Merged
cbulock merged 6 commits into
mainfrom
zeno/a11y-component-audit-fixes
Jun 30, 2026
Merged

fix: improve popup accessibility semantics#72
cbulock merged 6 commits into
mainfrom
zeno/a11y-component-audit-fixes

Conversation

@zeno-codebot

Copy link
Copy Markdown
Collaborator

Summary

  • make context-menu triggers keyboard-focusable and expose menu relationships
  • expose popup state and controls on date picker triggers
  • replace the date range picker's faux-focus field with a real button trigger and add coverage

Verification

  • npm test -- packages/core/src/components/context-menu/cindor-context-menu.test.ts packages/core/src/components/date-picker/cindor-date-picker.test.ts packages/core/src/components/date-range-picker/cindor-date-range-picker.test.ts
  • npx eslint packages/core/src/components/context-menu/cindor-context-menu.ts packages/core/src/components/date-picker/cindor-date-picker.ts packages/core/src/components/date-range-picker/cindor-date-range-picker.ts packages/core/src/components/context-menu/cindor-context-menu.test.ts packages/core/src/components/date-picker/cindor-date-picker.test.ts packages/core/src/components/date-range-picker/cindor-date-range-picker.test.ts
  • npm run typecheck (blocked by existing unrelated repo failures in split-button, transfer-list, and tree-view tests)

@cbulock cbulock left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Two accessibility/interaction regressions stood out in this pass.

Please remove the popup semantics from the clear-date affordance, and avoid making the context-menu wrapper itself a second interactive control when consumers already slot a real button trigger.

Comment thread packages/core/src/components/date-picker/cindor-date-picker.ts Outdated
Comment thread packages/core/src/components/context-menu/cindor-context-menu.ts Outdated

Copilot AI 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.

Pull request overview

This PR improves accessibility semantics for popup-style components in packages/core by making triggers keyboard focusable and wiring explicit ARIA relationships between triggers and their corresponding popup panels/menus.

Changes:

  • Added stable generated IDs for menus/calendars and wired aria-controls, aria-expanded, and aria-haspopup on relevant triggers.
  • Updated the date range picker to use a real <button> trigger for the summary (instead of a focusable <div>), aligning keyboard behavior with native button semantics.
  • Added/extended component tests to cover the new accessibility relationships and keyboard interactions.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/core/src/components/date-range-picker/cindor-date-range-picker.ts Adds a button-based summary trigger and wires popup ARIA relationships to the calendar panel.
packages/core/src/components/date-range-picker/cindor-date-range-picker.test.ts Adds coverage asserting the summary trigger’s popup relationships and open-state behavior.
packages/core/src/components/date-picker/cindor-date-picker.ts Wires popup ARIA relationships onto the readonly input trigger and icon-button controls.
packages/core/src/components/date-picker/cindor-date-picker.test.ts Adds coverage asserting popup relationship attributes and their updates when opened.
packages/core/src/components/context-menu/cindor-context-menu.ts Makes the trigger keyboard-focusable and adds ARIA relationships between trigger and menu.
packages/core/src/components/context-menu/cindor-context-menu.test.ts Adds coverage for keyboard-open behavior and trigger/menu relationship attributes.

Comment on lines 174 to 178
<cindor-icon-button
aria-controls=${this.panelId}
aria-expanded=${String(this.open)}
aria-haspopup="grid"
label="Clear date"
Comment on lines 145 to 149
<cindor-icon-button
aria-controls=${this.panelId}
aria-expanded=${String(this.open)}
aria-haspopup="grid"
label=${this.open ? "Close calendar" : "Open calendar"}
Comment thread packages/core/src/components/context-menu/cindor-context-menu.ts Outdated
@cbulock cbulock merged commit d489e98 into main Jun 30, 2026
6 checks passed
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.

3 participants