Skip to content
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

[select] fix: ItemRendererProps type regression #5944

Merged
merged 2 commits into from
Feb 14, 2023

Conversation

adidahiya
Copy link
Contributor

Fixes #5943

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

  • Make ref property optional in ItemRendererProps
  • Improve type of ref and handleClick properties in ItemRendererProps by using generic type params
  • Improve type of onClick and onFocus properties in ActionProps by adding generic type params
  • Add tests to select package for ItemRendererProps has a new unexpected required "ref" property #5943 regression

Reviewers should focus on:

Tests are accurate & sufficient

Screenshot

N/A

export interface ItemRendererProps {
/** A ref that receives the native HTML element rendered by this item. */
ref: Ref<any>;
export interface ItemRendererProps<T extends HTMLElement = HTMLLIElement, U extends HTMLElement = HTMLAnchorElement> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we need two type params because MenuItems are weird and attach their ref to a different DOM element than the click handler. we should probably reconcile that at some point 🤷🏽

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually, this turned out to be a bad approach. see #5946

@adidahiya
Copy link
Contributor Author

[select] fix: ItemRendererProps type regression

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@adidahiya
Copy link
Contributor Author

fix MenuItem references in tests

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

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.

ItemRendererProps has a new unexpected required "ref" property
1 participant