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(composed-modal): pass ref to ComposedModal and parts #10542

Merged

Conversation

kevinsperrine
Copy link
Contributor

@kevinsperrine kevinsperrine commented Jan 27, 2022

Closes #10543

A simple PR to add refs to the ComposedModal, ModalHeader, ModalBody, and ModalFooter components. We have a need to measure the content and automatically adjust the size of the modal based on the available space and the used space. This simplifies that process significantly.

Changelog

New

  • add forwardedRef prop to ComposedModal
  • add forwardedRef prop to ModalHeader
  • add forwardedRef prop to ModalFooter
    • These prop was not added to propTypes, so it doesn't have to be deprecated in v11 when switching to function props
  • added React.forwardRef to ModalBody
  • added React.forwardRef to next/ModalBody
  • added React.forwardRef to next/ModalHeader
  • added React.forwardRef to next/ModalFooter
  • added tests to confirm refs are properly forwarded and set

Testing / Reviewing

Confirm the unit tests are sufficient to confirm ref are passed and working

Verified

This commit was signed with the committer’s verified signature.
revatilimaye Revati Limaye
@kevinsperrine kevinsperrine requested review from a team as code owners January 27, 2022 18:00

Verified

This commit was signed with the committer’s verified signature.
revatilimaye Revati Limaye
@netlify
Copy link

netlify bot commented Jan 27, 2022

✔️ Deploy Preview for carbon-react-next ready!

🔨 Explore the source changes: 2d52389

🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-react-next/deploys/620d46d9ba00fe0007f622a9

😎 Browse the preview: https://deploy-preview-10542--carbon-react-next.netlify.app

@netlify
Copy link

netlify bot commented Jan 27, 2022

✔️ Deploy Preview for carbon-elements ready!

🔨 Explore the source changes: 2d52389

🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-elements/deploys/620d46d9f54ac9000865a614

😎 Browse the preview: https://deploy-preview-10542--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Jan 27, 2022

✔️ Deploy Preview for carbon-components-react ready!
Built without sensitive environment variables

🔨 Explore the source changes: 2d52389

🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-components-react/deploys/620d46d9ba00fe0007f622a4

😎 Browse the preview: https://deploy-preview-10542--carbon-components-react.netlify.app

Verified

This commit was signed with the committer’s verified signature.
revatilimaye Revati Limaye
Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

Looks good 👍 Thanks for mirroring the changes in next for v11!

Verified

This commit was signed with the committer’s verified signature.
revatilimaye Revati Limaye

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: pass refs to ComposedModal and parts
4 participants