Skip to content

[Bug]: Meeting-minutes modal is a keyboard trap — Escape does not close it and the close button is not focusable #686

Description

@Daksha1611

Describe the issue

In src/components/layout/CommunityMeetingsCardGrid/index.tsx, the "meeting minutes" modal is a native
<dialog> element (line 223-226) whose visibility is toggled via the open attribute:

<dialog open={isModalOpen} ref={modalRef}>

Native <dialog> only gets Escape-to-close, top-layer stacking, and focus-trapping behavior when it's
opened with dialogRef.current.showModal(). Toggling the open attribute directly opts out of all of that.

The only close affordances are:

  1. An outside click/touch listener (toggleModalOpen, lines 50-65) — mouse/touch only.

  2. A close icon rendered as a plain div with no keyboard access:

    setIsModalOpen(false)}>

It has no tabIndex, role="button", or onKeyDown handler.

Impact

A keyboard-only user who opens this modal (via a meeting's "meeting minutes" button) cannot close it —
Escape does nothing, and the close button is unreachable by Tab. This is a WCAG 2.1.2 "No Keyboard Trap"
failure and a real usability dead-end, not just a cosmetic issue.

Steps to reproduce

  1. Go to /community
  2. Tab to a meeting card's "meeting minutes" link and activate it with Enter/Space to open the modal
  3. Try pressing Escape, or Tab to the close icon and press Enter/Space — nothing closes the modal

Suggested fix

  • Call modalRef.current?.showModal() / .close() in an effect keyed on isModalOpen instead of toggling
    the open attribute directly, so native Escape-to-close and focus trapping work.
  • Make the close icon a real <button type="button" aria-label="Close"> (or add role="button",
    tabIndex={0}, and an onKeyDown handler) so it's keyboard-operable.

LLM Policy

  • This issue is human-written, and follow up comments will also be human-written

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions