carbon-design-system/carbon-for-ibm-dotcom-nextjs-template

[CTASection]: passing Onclick to the cta does not work

KIQsco opened this issue · 2 comments

Detailed description

I'm trying to use the CTA Section component, with CTA as a button. The buttons work properly except for the onClick property, that seems to be ignored. This is how I'm calling the component:

<CTASection {...props.contentBlockProps} cta={{ style: "button", type: "local", buttons: [{ type: "local", copy: "CTA 1", onClick: () => console.log(true) }] }} />

https://www.ibm.com/standards/carbon/react/?path=/story/components-cta-section--default

I used a similar approach in the LeadSpace component and it works fine.
Could you help me figured out this issue, please?

Inspecting the CTASection component code, on the "@carbon/ibmdotcom-react" package, seems that the prop type for "onClick" is not there

General

CTA Section component

The onClick should work as on the cta on leadspace

Google Chrome

Opening this ticket in the main carbon-for-ibm-dotcom repo here: carbon-design-system/carbon-for-ibm-dotcom#6844