Skip to content

Popup close controls use button roles but do not support Space-key activation #3241

Description

@gitbyapp

Summary

Several pop-up close controls are implemented as <a> elements with role="button", but their JavaScript handlers listen only for click.

Affected controls include:

<a href="" id="report-close" ... role="button"></a>
<a href="" id="share-close" ... role="button"></a>
<a href="" id="fittslaw" role="button" ...>

src/js/popup.js attaches only click handlers to these controls.

Accessibility problem

Adding role="button" causes assistive technology to expose these elements as buttons. Keyboard users therefore expect standard button keyboard behaviour.

A native anchor can be activated with Enter, but Space does not provide native button activation. This makes the semantic role and keyboard behaviour inconsistent.

Expected behavior

The preferred solution would be to use native:

<button type="button">

elements for these controls and preserve the existing visual styling.

If anchors need to be retained, keyboard handling should implement the expected Space/Enter button behaviour and prevent the default Space action where appropriate.

Using native buttons would also reduce the amount of custom accessibility behaviour that needs to be maintained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions