Skip to content

Conversation

@ychhabra-eightfold
Copy link
Collaborator

@ychhabra-eightfold ychhabra-eightfold commented Nov 7, 2025

SUMMARY:

This PR improves the accessibility of the Snackbar component by simplifying the tab focus behavior. Previously, the component used a firstTabPressedRef to track whether Tab had been pressed once, which prevented users from tabbing back to the snackbar after navigating away.

Changes:

  • Removed firstTabPressedRef state tracking
  • Simplified keyboard event handler to always redirect Tab press to the first closable snackbar's close button
  • Removed the effect that reset the ref when no closable snacks existed

Impact:
Users can now consistently tab to the snackbar's close button whenever they press Tab while a snackbar is visible, making the component more predictable and accessible.

GITHUB ISSUE (Open Source Contributors)

N/A

JIRA TASK (Eightfold Employees Only):

N/A

CHANGE TYPE:

  • Bugfix Pull Request
  • Feature Pull Request

TEST COVERAGE:

  • Tests for this change already exist
  • I have added unittests for this change

TEST PLAN:

  1. Run Storybook: yarn storybook
  2. Navigate to the Snackbar component
  3. Trigger a closable snackbar
  4. Press Tab key multiple times
  5. Verify that each Tab press focuses the first closable snackbar's close button
  6. Press Escape to dismiss
  7. Verify that Tab behavior works consistently across multiple snackbar displays

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 7, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@ychhabra-eightfold ychhabra-eightfold merged commit 14a0c22 into EightfoldAI:main Nov 7, 2025
4 of 6 checks passed
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.

2 participants