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

feat(PageLayout): support a ref on PageLayout.Pane #2324

Merged
merged 3 commits into from
Sep 13, 2022

Conversation

joshblack
Copy link
Member

@joshblack joshblack commented Sep 12, 2022

Reference https://github.com/github/primer/issues/1284

This PR updates PageLayout.Pane to use React.forwardRef and places the forwardRef on the Box wrapping children

Let me know if I'm interpreting the right element from #1284, I assumed it was the Box surrounding the children of the component 👀 I also tried to type the React.forwardRef correctly but would love a second look at that to see if I got the type correct.

@joshblack joshblack requested review from colebemis and a team September 12, 2022 19:35
@changeset-bot
Copy link

changeset-bot bot commented Sep 12, 2022

🦋 Changeset detected

Latest commit: 0474b7b

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

This PR includes changesets to release 1 package
Name Type
@primer/react 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 Sep 12, 2022

size-limit report 📦

Path Size
dist/browser.esm.js 76.3 KB (+0.02% 🔺)
dist/browser.umd.js 76.94 KB (+0.02% 🔺)

@joshblack joshblack temporarily deployed to github-pages September 12, 2022 19:42 Inactive
Copy link
Contributor

@colebemis colebemis left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks, @joshblack!

Can you update the prop documentation table for PageLayout.Pane to include this ref prop?

We have a utility component to make this easy:

<PropsTableRefRow
    elementType="div"
    refType="HTMLDivElement"
  />

Example: https://primer.style/react/Textarea#props

@joshblack
Copy link
Member Author

Thanks @colebemis! And of course, done ✨

@joshblack joshblack enabled auto-merge (squash) September 13, 2022 21:11
@joshblack joshblack temporarily deployed to github-pages September 13, 2022 21:17 Inactive
@joshblack joshblack merged commit 027e44a into main Sep 13, 2022
@joshblack joshblack deleted the 1284-add-ref-to-scrollable-pane branch September 13, 2022 21:19
@primer-css primer-css mentioned this pull request Sep 13, 2022
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