-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(HeaderPanel): Initialize onHeaderPanelFocus
with default value
#14351
Conversation
✅ Deploy Preview for carbon-components-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks for this! Just a couple minor suggestions
packages/react/src/components/UIShell/__tests__/HeaderPanel-test.js
Outdated
Show resolved
Hide resolved
DCO Assistant Lite bot: Thanks for your submission! We ask that you all sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by adding a comment below using this text: I have read the DCO document and I hereby sign the DCO. 2 out of 3 committers have signed the DCO. |
I don't think there's a way to override the DCO check specifically but we can merge with that one failing here I think. |
Thanks @tay1orjones!! Thank you for pushing those changes, as well. I made the |
Changelog
Changed
HeaderPanel
has a prop,onHeaderPanelFocus
, which is typed to be an optional function, but the component logic calls the function indiscriminately as if it were a required property. This is causing adopters to have errors when usingHeaderPanel
without that property defined.Updating the component to initialize the optional prop with an inert function. I'm not sure if that's an acceptable fix, or not. Alternatives may be:
onHeaderPanelFocus
requiredonHeaderPanelFocus
being defined prior to calling it within the component's logic.Testing / Reviewing
Specs have been added. Checkout this branch and run
yarn test -- headerpanel
with and without theonHeaderPanelFocus
prop being initialized to see the fix.vs.