Skip to content

[Bug] Header fullscreen/close controls lack accessible names and use hardcoded icon fills #1880

Open

Description

@PARTH-TUSSLE

Current Behavior

In src/custom/Modal/index.tsx, the modal header actions are not properly accessible:

  1. The enter/exit fullscreen controls are the styled FullScreenIcon / FullScreenExitIcon SVG components with an onClick. They appear to be plain SVGs rather than buttons, so they have no role and no accessible name, and they are probably not keyboard-focusable. Please verify with a keyboard and a screen reader. The surrounding CustomTooltip only helps on hover.
  2. The close control is an IconButton (CloseBtn) with no aria-label, so a screen reader announces only "button".
  3. CloseBtn hardcodes fill: #fff (and CloseIcon passes fill="#fff") instead of using the theme/token or inheriting currentColor. The fullscreen icons already use theme.palette.common.white, so the header is inconsistent.

This conflicts with the existing guidance in DESIGN.md ("Semantic ARIA: icon-only buttons must supply descriptive aria-label and Tooltip").

Expected Behavior

  • Fullscreen toggle: a native, keyboard-operable button (for example MUI IconButton) with aria-label "Enter fullscreen" / "Exit fullscreen", keeping the existing tooltip and data-testids (modal-enter-fullscreen-btn, modal-exit-fullscreen-btn).
  • Close control: aria-label="Close dialog" (keep data-testid="modal-close-btn").
  • Icon colors come from the existing theme token or inherit via currentColor (the header's color) rather than a hardcoded literal.
  • Keep this focused on the header controls: no layout or styling redesign.

Acceptance Criteria

  • getByRole('button', { name: 'Enter fullscreen' }), { name: 'Exit fullscreen' } and { name: 'Close dialog' } resolve in tests.
  • Both controls can be focused and activated with Tab, Enter and Space.
  • No hardcoded color literals remain in the header controls.
  • Existing Modal tests and data-testids keep passing.
  • Does not change Modal / useModal public props.

Context

Screenshots/Logs

Environment


Contributor Guides and Resources

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions