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

Having text wrapped inside OverflowMenu causes rendering to fail when minifying due to child props mapping #7837

Closed
1 of 2 tasks
KyeMaloy97 opened this issue Feb 18, 2021 · 0 comments · Fixed by #7838
Closed
1 of 2 tasks

Comments

@KyeMaloy97
Copy link

KyeMaloy97 commented Feb 18, 2021

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Detailed description

Describe in detail the issue you're having.

If you have the following code then there is a rendering bug which causes the component to stop working. The text inside the OverflowMenu seems to be causing React to add the text as a child node, and this doesn't have any props and there is no check that is has no props.

The exception states: TypeError: Cannot read property 'closeMenu' of undefined

<OverflowMenu> 
Some text here
</OverflowMenu>

Is this issue related to a specific component?

Yes, specifically OverflowMenu component, on line 497

What did you expect to happen? What happened instead? What would you like to
see changed?

A null check on the child.props should ensure the bug is resolved.

What browser are you working in?
Chrome Version 88.0.4324.150 (Official Build) (x86_64)

What version of the Carbon Design System are you using?

Bug is from 7.27.0 and was introduced in PR #7456, reverting to 7.25.0 fixes the issue.

What offering/product do you work on? Any pressing ship or release dates we
should be aware of?

Bug was discovered by the My Invenio team, an external company working with IAF on integrating their product into IAF.

Steps to reproduce the issue

  1. The code block above describes how to recreate the bug locally.

Please create a reduced test case in CodeSandbox

Sandbox is located here: https://codesandbox.io/s/modern-tree-3qt0i

Additional information

  • Screenshots or code
  • Notes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants