Skip to content

Image: Improve accessibility #57254

@Pareder

Description

@Pareder

What problem does this feature solve?

There are several accessibility issues regarding Image component:

  1. Preview cannot be opened by keyboard users because image does not receive focus. It does not fit WCAG success criterions 2.1.1 and 2.1.3.
  2. When preview is opened the dialog does not receive focus. It does not fit WCAG success criterions 1.3.1 and 2.4.3.
  3. Preview buttons like Close, Swap, Flip, Zoom, etc. cannot be focused via keyboard. It does not fit WCAG success criterions 2.1.1 and 2.1.3.

What does the proposed API look like?

  1. Adding role="button" to image wrapper div should help. It can be done only if preview !== false.
  2. Adding role="dialog" to modal dialog should help.
  3. Use correct button elements or at least pass role="button". Also add some focus styles because current outline: none will overried default styles.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions