Skip to content

fix(picker): should have focused state on click #5566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Rajdeepc
Copy link
Contributor

@Rajdeepc Rajdeepc commented Jun 25, 2025

Description

Fixed an issue where the focus ring was not being applied to the picker button when clicked, causing the focus ring to be invisible after the picker closed and the button regained focus.

Problem

  • Issue: Clicking the picker button and making a selection would close the picker, but the focus ring was not being applied to the button when it regained focus.
  • Impact: Users couldn't see the focus ring after interacting with the picker, making it unclear which element had focus.
  • Test Failure: The "manages focus-ring styles" test was failing because it expected the focus ring to be visible after the picker closed.

Root Cause

The focus management logic was not properly setting the focused property when the button received focus, preventing the focus ring CSS classes from being applied.

Solution

  • Enhanced focus management: Modified the InteractionController.handleButtonFocus() method to properly set the focused property when the button receives focus.
  • Fixed focus ring visibility: Ensured the focus ring is visible after clicking and selecting an option.
  • Maintained existing behavior: Preserved all existing focus management functionality while fixing the focus ring visibility.
  • All browsers: Focus ring now properly visible after picker interactions
  • No breaking changes: Existing behavior preserved

Accessibility Impact

  • Positive: Users can now see which element has focus after interacting with the picker
  • WCAG 2.1: Better compliance with focus visibility requirements
  • Screen readers: No impact on existing accessibility features

TODO

  1. SAFARI RING CLASS test is failing in MobileController.ts.

Related issue(s)

  • TBD

Screenshots (if appropriate)


Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

  • Descriptive Test Statement

    1. Go here
    2. Do this action
    3. Expect this result
  • Descriptive Test Statement

    1. Go here
    2. Do this action
    3. Expect this result

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

@Rajdeepc Rajdeepc self-assigned this Jun 25, 2025
Copy link

changeset-bot bot commented Jun 25, 2025

⚠️ No Changeset found

Latest commit: 3fa3708

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.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

Copy link

📚 Branch Preview

🔍 Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-5566

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

Copy link

Tachometer results

Currently, no packages are changed by this PR...

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.

1 participant