Skip to content

Commit 02de000

Browse files
committed
fix: onchange dropdown checkbox
1 parent 68424ca commit 02de000

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@beeinventor/dasiot-react-component-lib",
3-
"version": "1.7.3",
3+
"version": "1.7.4",
44
"module": "lib/index.js",
55
"types": "lib/index.d.ts",
66
"files": [

src/components/Dropdown/DropdownCheckbox/DropdownCheckbox.tsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,6 @@ const DropdownCheckbox: React.VFC<DropdownCheckboxProps> = (props) => {
103103
setIsOpen(false);
104104
};
105105

106-
useEffect(() => {
107-
if (itemChecked.length > 0) {
108-
onSelect(itemChecked);
109-
}
110-
}, [itemChecked]);
111-
112106
useEffect(() => {
113107
if (selectedIds === undefined || selectedIds.length === 0) {
114108
setItemChecked([]);
@@ -126,6 +120,7 @@ const DropdownCheckbox: React.VFC<DropdownCheckboxProps> = (props) => {
126120
updateValue.push(newValue);
127121
}
128122
setItemChecked(updateValue);
123+
onSelect(updateValue);
129124
};
130125

131126
const items = list

0 commit comments

Comments
 (0)