@codacy/ui-components 0.66.64 → 0.66.66
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.
|
@@ -22,9 +22,10 @@ export const CheckboxFilterList = ({
|
|
|
22
22
|
}
|
|
23
23
|
//Range selection
|
|
24
24
|
else {
|
|
25
|
-
const range = [items.findIndex(i => i.key === prevCheckedBox), items.findIndex(i => i.key === key)].sort();
|
|
25
|
+
const range = [items.findIndex(i => i.key === prevCheckedBox), items.findIndex(i => i.key === key)].sort((a, b) => a - b);
|
|
26
26
|
const itemsInRange = items.slice(range[0], range[1] + 1);
|
|
27
|
-
|
|
27
|
+
const newKeys = itemsInRange.map(i => i.key).filter(k => !value.includes(k));
|
|
28
|
+
onChange([...value, ...newKeys]);
|
|
28
29
|
}
|
|
29
30
|
setPrevCheckedBox(key);
|
|
30
31
|
} else {
|
package/lib/Input/Input.js
CHANGED
|
@@ -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:
|
|
22
|
+
onClick: handleClick
|
|
16
23
|
}, /*#__PURE__*/React.createElement(Icon, icon)) : /*#__PURE__*/React.createElement(IconComponent, {
|
|
17
24
|
isClickable: !!onClick,
|
|
18
|
-
onClick:
|
|
25
|
+
onClick: handleClick
|
|
19
26
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
20
27
|
icon: icon,
|
|
21
28
|
color: "input-icon-enabled"
|