Skip to content

fix(content-block-paragraph): fixing the logic to hide the component … #12214

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

Conversation

bruno-amorim
Copy link
Contributor

…when no copy

Description

In this PR #12198, we created a logic to hide the component if it has no copy, however, that logic that hides and displays, was only considering direct text nodes, but in AEM we have a div for the RTE and only then the text content. It was resulting in the component to hide even if there's copy

Changelog

Modified the logic for the method toggleVisibility() to also look for any text or element nodes, in case of element nodes, we'll check if they have text content.

@bruno-amorim bruno-amorim requested a review from a team as a code owner February 19, 2025 20:06
@bruno-amorim bruno-amorim requested review from marcelojcs and Valentin-Sorin-Nicolae and removed request for a team February 19, 2025 20:06
Copy link

netlify bot commented Feb 19, 2025

Deploy Preview for incomparable-wisp-8d6771 ready!

Name Link
🔨 Latest commit 60b47d6
🔍 Latest deploy log https://app.netlify.com/sites/incomparable-wisp-8d6771/deploys/67b72aa3ff2eb80008715b8a
😎 Deploy Preview https://deploy-preview-12214--incomparable-wisp-8d6771.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.

Copy link

netlify bot commented Feb 19, 2025

Deploy Preview for ibm-dotcom-web-components-react-wrap ready!

Name Link
🔨 Latest commit 60b47d6
🔍 Latest deploy log https://app.netlify.com/sites/ibm-dotcom-web-components-react-wrap/deploys/67b72aa30c40d8000852b374
😎 Deploy Preview https://deploy-preview-12214--ibm-dotcom-web-components-react-wrap.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.

Copy link

netlify bot commented Feb 19, 2025

Deploy Preview for ibm-dotcom-web-components ready!

Name Link
🔨 Latest commit 60b47d6
🔍 Latest deploy log https://app.netlify.com/sites/ibm-dotcom-web-components/deploys/67b72aa3292cfc000816d4a1
😎 Deploy Preview https://deploy-preview-12214--ibm-dotcom-web-components.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.

Copy link
Contributor

@marcelojcs marcelojcs left a comment

Choose a reason for hiding this comment

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

Works wonderfully!
Great job!!

@marcelojcs marcelojcs added the Ready to merge Label for the pull requests that are ready to merge label Feb 20, 2025
@kodiakhq kodiakhq bot merged commit dcf6bf2 into carbon-design-system:main Feb 20, 2025
22 of 23 checks passed
marcelojcs pushed a commit that referenced this pull request Feb 20, 2025
#12214)

…when no copy

In this PR #12198, we created a logic to hide the component if it has no copy, however, that logic that hides and displays, was only considering direct text nodes, but in AEM we have a div for the RTE and only then the text content. It was resulting in the component to hide even if there's copy

Modified the logic for the method `toggleVisibility()` to also look for any text or element nodes, in case of element nodes, we'll check if they have text content.
Copy link
Contributor

Hey there! This issue/pull request was referenced in recently released v2.17.1.

1 similar comment
Copy link
Contributor

Hey there! This issue/pull request was referenced in recently released v2.17.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready to merge Label for the pull requests that are ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants