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

fix(react): warnings from SideNav in console from inert prop #15047

Merged
merged 10 commits into from
Nov 21, 2023
Merged

fix(react): warnings from SideNav in console from inert prop #15047

merged 10 commits into from
Nov 21, 2023

Conversation

kuri-sun
Copy link
Contributor

@kuri-sun kuri-sun commented Oct 27, 2023

Closes #14990

Bug Description

In storybook, Rail type of SideNav will produce this console warning.

Warning: Received "false" for a non-boolean attribute "inert".

If you want to write it to the DOM, pass a string instead: inert="false" or inert={value.toString()}.

If you used to conditionally omit it with inert={condition && value}, pass inert={condition ? value : undefined} instead.
at nav
at SideNavRenderFunction (c:\GitClones\CDD-Hub\node_modules\@carbon\react\lib\components\UIShell\SideNav.js:38:15)

error_msg

Changelog

Changed

  • Make sure that it does not pass boolean value to inert property for nav HTML component. (line.242 in Sidebar.tsx)


Testing / Reviewing

Checklist
(Cause)

The inert property throwing the error was passed boolean value.
If a Sidebar component is Rail type, this condition returns false which inert property does not accept.

It resulted as a console error, only for Rail type.

(Solution)

When isRail property gets passed to SideNav component, that inert property should be undefined.

Test
After opening up Rail type SideNav component in storybook, there is no this console warning anymore.

@kuri-sun kuri-sun requested a review from a team as a code owner October 27, 2023 06:35
@github-actions
Copy link
Contributor

github-actions bot commented Oct 27, 2023

DCO Assistant Lite bot All contributors have signed the DCO.

@netlify
Copy link

netlify bot commented Oct 27, 2023

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit b5b0f7f
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/655cca2263868d00085ef592
😎 Deploy Preview https://deploy-preview-15047--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Oct 27, 2023

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit fa7826a
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/654bf71d5d94970008bafd0e
😎 Deploy Preview https://deploy-preview-15047--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kuri-sun
Copy link
Contributor Author

I have read the DCO document and I hereby sign the DCO.

@kuri-sun kuri-sun changed the title fix(react): warnings from SideNav in console from inert prop (#14990) fix(react): warnings from SideNav in console from inert prop Oct 27, 2023
Copy link
Collaborator

@tw15egan tw15egan left a comment

Choose a reason for hiding this comment

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

LGTM once merge is resolved 👍🏻

Copy link
Contributor

@andreancardona andreancardona 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, thank you for the contribution!

@andreancardona andreancardona added this pull request to the merge queue Nov 21, 2023
Merged via the queue into carbon-design-system:main with commit ffaf3e8 Nov 21, 2023
18 checks passed
danoro96 pushed a commit to danoro96/carbon that referenced this pull request Jan 18, 2024
…design-system#14990) (carbon-design-system#15047)

Co-authored-by: Andrea N. Cardona <cardona.n.andrea@gmail.com>
Co-authored-by: TJ Egan <tw15egan@gmail.com>
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.

[Bug]: warnings from SideNav in console log from inert prop
3 participants