Skip to content

Update tabbing behaviour for Popover component#2418

Draft
cemms1 wants to merge 1 commit into
mainfrom
cemms1/popover-tab-behaviour
Draft

Update tabbing behaviour for Popover component#2418
cemms1 wants to merge 1 commit into
mainfrom
cemms1/popover-tab-behaviour

Conversation

@cemms1

@cemms1 cemms1 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

What are you changing?

Updates the tab behaviour for the Popover component in source-development-kitchen so that when the popover is opened, the keyboard focus is trapped within the popover until the user takes an action to dismiss it

The popover can still be dismissed by using the escape key or by clicking the dismiss/close button

Why?

After discussing as a team, it felt more intuitive for keyboard users and those using screen readers for the focus to be trapped when opening the Popover since otherwise the focus moves to the next tabbable component on the page, which can be behind the popover in terms of z-index value. Being able to focus on elements which are not entirely visible on the screen feels like poor UX.

The guidance for this online is mixed and in general suggests that you should only trap focus for "modal" popover content and not for non-modal popovers. This is not technically a modal popover

@cemms1 cemms1 requested review from a team as code owners June 23, 2026 10:48
@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 15a2448

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cemms1 cemms1 marked this pull request as draft June 23, 2026 10:48
@github-actions github-actions Bot added the 📦 npm Affects a @guardian package on NPM label Jun 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Tip

Once this PR is ready to go, add the run_chromatic label to run the Chromatic tests.

This saves us a lot of money by not running the tests before we need them.

@cemms1 cemms1 force-pushed the cemms1/popover-tab-behaviour branch from 2dacec0 to 15a2448 Compare June 30, 2026 07:29
@cemms1 cemms1 changed the title update tabbing behaviour for popover component Update tabbing behaviour for Popover component Jun 30, 2026
@cemms1 cemms1 added the maintenance Departmental tracking: maintenance work, not a fix or a feature label Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Departmental tracking: maintenance work, not a fix or a feature 📦 npm Affects a @guardian package on NPM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant