Skip to content

Commit c7882d5

Browse files
author
Mahesh Kothur
committed
feat(component): revert the change back to onClick event
1 parent 76e32fd commit c7882d5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/react/src/components/CTA/CTA.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const CTA = ({ style, type, ...cta }) => {
3535
href={cta.href}
3636
icon={_iconSelector(type)}
3737
target={_external(type)}
38-
onMouseDown={e => _jump(e, type)}
38+
handleClick={e => _jump(e, type)}
3939
/>
4040
);
4141
case 'button':
@@ -53,7 +53,7 @@ const CTA = ({ style, type, ...cta }) => {
5353
<LinkWithIcon
5454
href={cta.href}
5555
target={_external(type)}
56-
onMouseDown={e => _jump(e, type)}>
56+
onClick={e => _jump(e, type)}>
5757
{cta.copy}
5858
<Icon />
5959
</LinkWithIcon>
@@ -101,7 +101,7 @@ const _iconSelector = type =>
101101
const _renderButtons = ({ buttons }) =>
102102
buttons.map(button => {
103103
button.renderIcon = _iconSelector(button.type);
104-
button.onMouseDown = e => _jump(e, button.type);
104+
button.onClick = e => _jump(e, button.type);
105105
button.target = _external(button.type);
106106
return button;
107107
});
@@ -115,7 +115,7 @@ const _renderButtons = ({ buttons }) =>
115115
*/
116116
const _renderFeatureCard = featureCard => {
117117
featureCard.icon = _iconSelector(featureCard.type);
118-
featureCard.onMouseDown = e => _jump(e, featureCard.type);
118+
featureCard.handleClick = e => _jump(e, featureCard.type);
119119
featureCard.target = _external(featureCard.type);
120120
return featureCard;
121121
};

packages/utilities/src/utilities/smoothScroll/smoothScroll.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
*/
77

88
/**
9-
* Utility handles smoothScroll to the target element after onMouseDown
9+
* Utility handles smoothScroll on the anchor element after onClick
1010
*
1111
* @example
1212
* import { smoothScroll } from '@carbon/ibmdotcom-utilities';
1313
*
14-
* <a href="#anchorlinkname" onMouseDown={smoothScroll(e)}>lorem ipsum</a>
14+
* <a href="#anchorlinkname" onClick={smoothScroll(e)}>lorem ipsum</a>
1515
*
1616
* You can use this for jump to target element by providing event object.
1717
* it will scroll into view of target by selecting attribute and assigning to id.

0 commit comments

Comments
 (0)