Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion packages/web-components/src/components/card/card-footer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license
*
* Copyright IBM Corp. 2020, 2024
* Copyright IBM Corp. 2020, 2025
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand Down Expand Up @@ -45,6 +45,18 @@ class C4DCardFooter extends C4DLinkWithIcon {
return Boolean(parentHref) && (!href || parentHref === href);
}

/**
* Contact Module won't work if card-footer has parent-href attribute
* this function removes parent-href if the cta type is 'chat' or 'contact'
*/
protected _cleanParentHrefForContactModule() {
const { ctaType } = this;

if (ctaType === 'chat' || ctaType === 'contact') {
this.removeAttribute('parent-href');
}
}

/**
* Handles `slotchange` event on the default `<slot>`.
*/
Expand Down Expand Up @@ -134,6 +146,8 @@ class C4DCardFooter extends C4DLinkWithIcon {
if (iconInline) {
targetNode!.classList.add(`${prefix}--link-with-icon--inline-icon`);
}

this._cleanParentHrefForContactModule();
}

static get stableSelector() {
Expand Down
7 changes: 6 additions & 1 deletion packages/web-components/src/components/cta/defs.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license
*
* Copyright IBM Corp. 2020, 2023
* Copyright IBM Corp. 2020, 2025
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand Down Expand Up @@ -101,6 +101,11 @@ export enum CTA_TYPE {
*/
CHAT = 'chat',

/**
* Another CTA variation with a chat icon, whose action opens the chat widget.
*/
CONTACT = 'contact',

/**
* CTA with a phone icon, whose action opens default telephony app.
*/
Expand Down
Loading