Skip to content

fix: CoachMarkContext and SlottedContextValue types for autocomplete#9423

Merged
reidbarber merged 1 commit intoadobe:mainfrom
unional:context-value
Jan 7, 2026
Merged

fix: CoachMarkContext and SlottedContextValue types for autocomplete#9423
reidbarber merged 1 commit intoadobe:mainfrom
unional:context-value

Conversation

@unional
Copy link
Copy Markdown
Contributor

@unional unional commented Dec 30, 2025

Closes #9422

Note that this PR fix the type which is technically breaking, as it makes the type validation function properly.

The change to CoachMark.tsx shows the breakage:

- export const CoachMarkContext = createContext<ContextValue<CoachMarkProps, HTMLElement>>({});
+ export const CoachMarkContext = createContext<ContextValue<Partial<CoachMarkProps>, HTMLElement>>({});

Although the breakage can be "avoided" by:

- export type SlottedContextValue<T> = SlottedValue<T> & T | null | undefined;
+ export type SlottedContextValue<T> = SlottedValue<T> & Partial<T> | null | undefined;

Keeping the Partial<T> in user land is more flexible and more correct, e.g. if the user want to NOT doing Partial<T> for their specific use case.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Run yarn check-types

@snowystinger snowystinger changed the title fix: update CoachMarkContext and SlottedContextValue types for better… fix: CoachMarkContext and SlottedContextValue types for autocomplete Jan 3, 2026
Copy link
Copy Markdown
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the CoachMark one looks like it's now being handled the same way as the Button in S2, so I think that's fine.

Comment thread packages/react-aria-components/src/utils.tsx Outdated
@reidbarber reidbarber added this pull request to the merge queue Jan 7, 2026
Merged via the queue into adobe:main with commit a4065ed Jan 7, 2026
31 checks passed
@yihuiliao yihuiliao added the no testing Does not require manual testing during testing session label Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no testing Does not require manual testing during testing session ready for review small review Easy to review PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TypeScript]: autocomplete is not available on ContextValue<T, E>

4 participants