@codacy/ui-components 0.66.64 → 0.66.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,12 +10,19 @@ const InputIcon = ({
10
10
  onClick
11
11
  }) => {
12
12
  const IconComponent = toRight ? RightIcon : LeftIcon;
13
+
14
+ // hack: basically, without stopping propagation, the onClick event will be triggered twice due to
15
+ // handleSurroundings on the dropdown hooks file
16
+ const handleClick = React.useCallback(e => {
17
+ e.stopPropagation();
18
+ onClick === null || onClick === void 0 || onClick(e);
19
+ }, [onClick]);
13
20
  return icon.hasOwnProperty('icon') ? /*#__PURE__*/React.createElement(IconComponent, {
14
21
  isClickable: !!onClick,
15
- onClick: onClick
22
+ onClick: handleClick
16
23
  }, /*#__PURE__*/React.createElement(Icon, icon)) : /*#__PURE__*/React.createElement(IconComponent, {
17
24
  isClickable: !!onClick,
18
- onClick: onClick
25
+ onClick: handleClick
19
26
  }, /*#__PURE__*/React.createElement(Icon, {
20
27
  icon: icon,
21
28
  color: "input-icon-enabled"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/ui-components",
3
- "version": "0.66.64",
3
+ "version": "0.66.65",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "",