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

Updates ActionList's ItemInput type to accept DOM props for divs when renderItem is not provided #1497

Merged
merged 2 commits into from
Oct 5, 2021

Conversation

jfuchs
Copy link
Contributor

@jfuchs jfuchs commented Oct 4, 2021

This PR widens our ActionList component's ItemInput type so that DOM props for div are allowed. This is only a type change and should not change the function of the compiled code.

This surfaced when @smockle was upgrading PRC in an internal project from v30.0.0 to v30.1.0, and noticed that that project's usage of PRC included passing onMouseDown listeners in the ItemInput objects. This PR restores correct typing for that usage.

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@jfuchs jfuchs requested review from smockle and a team October 4, 2021 23:47
@changeset-bot
Copy link

changeset-bot bot commented Oct 4, 2021

🦋 Changeset detected

Latest commit: a206456

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/components Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2021

size-limit report 📦

Path Size
dist/browser.esm.js 55.41 KB (0%)
dist/browser.umd.js 55.73 KB (0%)

@@ -10,7 +10,9 @@ import {hasActiveDescendantAttribute} from '../behaviors/focusZone'

type RenderItemFn = (props: ItemProps) => React.ReactElement

export type ItemInput = ItemProps | ((Partial<ItemProps> & {renderItem: RenderItemFn}) & {key?: Key})
export type ItemInput =
Copy link
Member

Choose a reason for hiding this comment

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

Since ActionList’s items type now diverges from ItemProps, does the props documentation for ActionList need to be updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, thanks!

@smockle smockle merged commit b9d6a66 into main Oct 5, 2021
@smockle smockle deleted the jfuchs/wider-item-type branch October 5, 2021 18:23
@primer-css primer-css mentioned this pull request Oct 5, 2021
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.

None yet

2 participants