Repository navigation
Conversation
snowystinger
approved these changes
Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #6460
Summary
ColorSwatchPickerItemalready supportsHoverEventsandPressEvents, so addingFocusEventsgives keyboard and focus users parity with hover interactions and matches the collection items updated for#6460(#10822forGridListItem,#10857forTablerows, and#10993forTreeItem). This lets callers attachonFocus,onBlur, andonFocusChangedirectly toColorSwatchPickerItemwithout tracking focus state manually via render props.Because
ColorSwatchPickerItemalready forwards its props toListBoxItem(which callsuseFocus(props)and filters DOM focus handlers viafilterDOMProps), the implementation only needsColorSwatchPickerItemPropsto extendFocusEvents<HTMLDivElement>. Alongside the type update inpackages/react-aria-components/src/ColorSwatchPicker.tsx, I added aReact Aria Components/ColorSwatchPickerStorybook file with anItemFocusEventsstory and unit tests inColorSwatchPicker.test.js.📝 Test Instructions
Before updating
ColorSwatchPickerItemProps, adding theItemFocusEventsstory causedcorepack yarn check-typesto fail withTS2322: Property 'onFocus' does not exist on type 'IntrinsicAttributes & ColorSwatchPickerItemProps & RefAttributes<HTMLDivElement>'.After updating
packages/react-aria-components/src/ColorSwatchPicker.tsx:corepack yarn format packages/react-aria-components/src/ColorSwatchPicker.tsx packages/react-aria-components/stories/ColorSwatchPicker.stories.tsx packages/react-aria-components/test/ColorSwatchPicker.test.js: finished on 3 files (verified LF line endings).corepack yarn jest packages/react-aria-components/test/ColorSwatchPicker.test.js: 1 passed suite, 9 passed, 9 total (including keyboard transitions withTab/ArrowRight, mouse transitions,data-focused/data-focus-visibleattributes, and focused rerender stability).corepack yarn jest packages/react-aria-components/test/ColorSwatchPicker.test.js packages/@adobe/react-spectrum/test/color/ColorSwatchPicker.test.js packages/react-aria-components/test/ListBox.test.js: 3 passed suites, 122 passed, 1 pre-existing skipped test, 123 total.corepack yarn lint: exited 0 (yarn format:check,yarn check-types,oxlint packageswith 0 warnings and 0 errors,node scripts/lint-packages.js, andyarn constraints).Not tested locally: full monorepo
yarn test,yarn test:ssr,yarn test:browser, screen reader, RTL, or interactive browser verification in Storybook (only jsdom tests and type-checking/linting were run locally).Release impact
✅ PR Checklist
#6460, draft the Storybook story and Jest tests, and verify lint/type checks; all diffs and test runs were reviewed locally.)🧢 Your Project
Personal contribution.