-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(parent-visibility): Make changes for v2 (#11797)
### Related Ticket(s) None ### Description We created the ParentVisibility mixin in v1 to address problematic interactions between components that used the `sameHeight` utility and components that conditionally show/hide child elements. It was designed to work on any element that potentially hid content, but in practice Tabs was the only one that we ever experienced problems with. The Tabs component underwent fundamental changes in v2, and as a result, the ParentVisibility mixin no longer works. Instead of refactoring it, we can use new CSS specs to replace the sameHeight behavior while removing a bunch of JavaScript. While working on this, I noticed a visual regression. The CTA Block content items' CTAs stack in v1, but that wasn't happening in v2. A simple bit of CSS fixes this. **v1:** <img width="391" alt="Screenshot 2024-05-20 at 9 28 01 AM" src="https://github.com/carbon-design-system/carbon-for-ibm-dotcom/assets/12532727/cb91d25d-1f9e-42d2-9e5e-a8cb73e25934"> **v2:** <img width="391" alt="Screenshot 2024-05-20 at 9 28 10 AM" src="https://github.com/carbon-design-system/carbon-for-ibm-dotcom/assets/12532727/0a85087d-e4f0-4498-a8f7-cf6878cdb243"> ### Changelog **Changed** - Deprecates `ParentVisibility` mixin. - Replaces `<c4d-cta-block-item-row>`'s sameHeight JavaScript logic with CSS subgrid styles. - Fixes `<c4d-cta-block>`'s slotted CTA items visual regression from v1 to v2. - Fixes "CTA Block > Within Tabs" story. ### Testing Visit [the CTA Block > With content items deploy preview story](https://ibmdotcom-webcomponents.s3.us-east.cloud-object-storage.appdomain.cloud/deploy-previews/11797/index.html?path=/story/components-cta-block--with-content-items) and verify the content items each have the same height as each other, and that each of their sub-elements (e.g. heading, description text, etc.) have the same heights. Verify the same for content items in each tab in [the CTA Block > Within Tabs deploy preview story](https://ibmdotcom-webcomponents.s3.us-east.cloud-object-storage.appdomain.cloud/deploy-previews/11797/index.html?path=/story/components-cta-block--within-tabs). <!-- React and Web Component deploy previews are enabled by default. --> <!-- To enable additional available deploy previews, apply the following --> <!-- labels for the corresponding package: --> <!-- *** "test: e2e": Codesandbox examples and e2e integration tests --> <!-- *** "package: services": Services --> <!-- *** "package: utilities": Utilities --> <!-- *** "RTL": React / Web Components (RTL) --> <!-- *** "feature flag": React / Web Components (experimental) -->
- Loading branch information
Showing
5 changed files
with
30 additions
and
155 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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