Skip to content

fix(widget): keep focus in the popup on the consent notice and menu choices - #625

Open
bhushan4work wants to merge 1 commit into
codercops:devfrom
bhushan4work:608
Open

bhushan4work wants to merge 1 commit into
codercops:devfrom
bhushan4work:608

Conversation

@bhushan4work

Copy link
Copy Markdown
Collaborator

What does this change?

Fix the two places focus escaped the popup dialog.

  • With waitForConsent: true, opening the popup now focuses the consent notice, which gets tabindex="-1", so it is announced and Escape closes the chat. Inline mode keeps its existing behavior and does not take focus.
  • Choosing a header menu item by click, Enter or Space now returns focus to the More options button, matching Escape.

Added unit tests for both focus paths, updated the S17 and header menu e2e tests to assert focus, and added a patch changeset for @chatcops/widget.

Closes #608

How I tested this

Ran pnpm test:coverage, pnpm lint, pnpm size, and pnpm e2e; all pass.

AI assistance

None

Checklist

  • This PR targets dev
  • I was assigned the linked issue
  • pnpm -r build, pnpm test and pnpm -r typecheck pass locally
  • Tests added or updated where it makes sense
  • For a bug fix: the new test fails without my change
  • Changeset added (pnpm changeset) if this changes core, widget or server
  • pnpm api run and api/ committed if an exported type or option changed
  • Docs updated if behavior or options changed

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Focus escapes the popup on the consent notice and after a header menu choice

1 participant