Skip to content

feat: add focus events to GridListItem - #10822

Open
dagemawinegash wants to merge 1 commit into
adobe:mainfrom
dagemawinegash:feat/grid-list-item-focus-events
Open

dagemawinegash wants to merge 1 commit into
adobe:mainfrom
dagemawinegash:feat/grid-list-item-focus-events

Conversation

@dagemawinegash

Copy link
Copy Markdown

Adds onFocus, onBlur, and onFocusChange to GridListItem for mouse and keyboard interaction, using the existing useFocus hook. Includes regression tests and an interactive Storybook example.

Part of #6460 (GridListItem only; table Row is outside this change).

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub issue.
  • Added unit tests and a Storybook example.
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the ARIA grid practices.
  • I understand every change in this PR and can explain why it's there.

API prop documentation derives from the inherited FocusEvents type; no separate documentation files were changed.

📝 Test Instructions:

  1. Run yarn start and open React Aria Components → GridList → Item Focus Events.
  2. Click different items, then use Tab and arrow keys. Verify the Actions panel reports focus, blur, and focus-change callbacks while selection and focus rings continue to work.
  3. Run yarn test packages/react-aria-components/test/GridList.test.js --runInBand.

Validation: all 110 GridList tests, repository lint, and all 74 SSR tests passed (SSR used a 120-second local timeout). The full unit run had 16 failing tests and the browser run had two failures. All reproduced with the original GridList source: unit failures involve Windows locale/path handling and an interactive codemod fixture; browser failures involve TokenField word deletion in Chromium and Firefox.

🧢 Your Project:

Independent open-source contribution.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant