Skip to content

feat(content-block): paragraph collapse if no text #12198

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

Valentin-Sorin-Nicolae
Copy link
Contributor

Related Ticket(s)

Closes # ADCMS-7497

Description

If no subheading or text will be added, the paragraph will collapse to reduce the space between the other elements.

Changelog

A display="none" will be added to the paragraph element if the <slot> will be empty.

Testing instructions

To test it, in the content-block component on Storybook, delete the Subheading text.

@Valentin-Sorin-Nicolae Valentin-Sorin-Nicolae requested a review from a team as a code owner January 28, 2025 15:52
@Valentin-Sorin-Nicolae Valentin-Sorin-Nicolae requested review from bruno-amorim and marcelojcs and removed request for a team January 28, 2025 15:52
Copy link

netlify bot commented Jan 28, 2025

Deploy Preview for incomparable-wisp-8d6771 ready!

Name Link
🔨 Latest commit cb99e65
🔍 Latest deploy log https://app.netlify.com/sites/incomparable-wisp-8d6771/deploys/67a22596d02a4f0008b9075c
😎 Deploy Preview https://deploy-preview-12198--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 Jan 28, 2025

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

Name Link
🔨 Latest commit cb99e65
🔍 Latest deploy log https://app.netlify.com/sites/ibm-dotcom-web-components-react-wrap/deploys/67a22596f1323900080d87e2
😎 Deploy Preview https://deploy-preview-12198--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 Jan 28, 2025

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

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

@marcelojcs marcelojcs added the Ready to merge Label for the pull requests that are ready to merge label Feb 4, 2025
@marcelojcs marcelojcs merged commit 004f551 into carbon-design-system:main Feb 4, 2025
23 checks passed
@Valentin-Sorin-Nicolae Valentin-Sorin-Nicolae deleted the content-block-heading-collapse branch February 4, 2025 21:12
Copy link
Contributor

github-actions bot commented Feb 7, 2025

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

kodiakhq bot pushed a commit that referenced this pull request Feb 20, 2025
#12214)

…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.
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.
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