Skip to content

Remove the closed popup panel from the tab order and close it with Escape #59

Closed

Description

@anurag629

In popup mode the chat panel is invisible when closed, but it's still in the tab order and the accessibility tree. Keyboard users tab through invisible controls, and there's no keyboard way to close the panel.

Where to look

  • packages/widget/src/dom/panel.ts, dom/fab.ts, dom/bubble.ts
  • packages/widget/src/widget.ts (open, close)
  • packages/widget/src/styles/widget.css (.cc-panel, .cc-bubble)
  • packages/widget/tests/dom/panel.test.ts, fab.test.ts

Acceptance criteria

  • A closed popup panel and a hidden welcome bubble can't be focused and aren't exposed to screen readers (e.g. inert plus aria-hidden="true", removed on open)
  • Open and close animations still work
  • Escape inside the open popup panel closes it (not in inline mode)
  • Focus returns to the FAB after closing
  • The FAB has aria-expanded and aria-controls pointing at the panel id
  • The panel has role="dialog" and an aria-label set to the branding name
  • Inline mode is unchanged
  • Tests cover the new attributes and the Escape key
  • Changeset for @chatcops/widget (patch)

Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.

Activity

  1. added
    help wantedExtra attention is needed
    widgetAffects @chatcops/widget package
    hacktoberfestGood pick for Hacktoberfest contributors
    accessibilityKeyboard, screen reader and a11y fixes
    on Sep 30, 2026
  2. prakashNalla commented on Oct 19, 2026

    @prakashNalla
    Collaborator

    I'd like to take this one. When the popup panel is closed I'll set inert and aria-hidden="true" on it and on the hidden welcome bubble, and remove them in open(). Escape in the open popup will call close() and focus goes back to the FAB. The FAB gets aria-expanded and aria-controls, the panel role="dialog" with the branding name as aria-label, and inline mode stays as it is. Tests in panel.test.ts and fab.test.ts, plus a patch changeset.

  3. anurag629 commented on Oct 19, 2026

    @anurag629
    MemberAuthor

    Hey @prakashNalla, it's yours! Your plan covers the whole list. The one thing it doesn't mention is the open and close animation: inert and aria-hidden leave it alone, but display: none or the hidden attribute would cut it, so stick with the first two. The files in the issue are all still where it says on dev.

    Let me know if you have any questions.

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

Metadata

Metadata

Assignees

Labels

accessibilityKeyboard, screen reader and a11y fixeshacktoberfestGood pick for Hacktoberfest contributorshelp wantedExtra attention is neededwidgetAffects @chatcops/widget package

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions