-
Notifications
You must be signed in to change notification settings - Fork 156
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
Merged
marcelojcs
merged 6 commits into
carbon-design-system:main
from
Valentin-Sorin-Nicolae:content-block-heading-collapse
Feb 4, 2025
Merged
feat(content-block): paragraph collapse if no text #12198
marcelojcs
merged 6 commits into
carbon-design-system:main
from
Valentin-Sorin-Nicolae:content-block-heading-collapse
Feb 4, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for incomparable-wisp-8d6771 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for ibm-dotcom-web-components-react-wrap ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for ibm-dotcom-web-components ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
marcelojcs
approved these changes
Feb 4, 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theSubheading
text.