Add toggleItemSelection callback
[arvados-workbench2.git] / src / views-components / projects-tree-picker / generic-projects-tree-picker.tsx
index 21839ff51e7d2e9c792ec93312ca7a6bd2fd26fe..77f831fafd10432fc1ec86513b1f9fa23cbdb646 100644 (file)
@@ -63,8 +63,11 @@ const mapDispatchToProps = (dispatch: Dispatch, { loadRootItem, includeCollectio
             dispatch(treePickerActions.TOGGLE_TREE_PICKER_NODE_COLLAPSE({ id, pickerId }));
         }
     },
-    toggleItemSelection: (_, { id }, pickerId) => {
-        dispatch<any>(treePickerActions.TOGGLE_TREE_PICKER_NODE_SELECTION({ id, pickerId }));
+    toggleItemSelection: (event, item, pickerId) => {
+        dispatch<any>(treePickerActions.TOGGLE_TREE_PICKER_NODE_SELECTION({ id: item.id, pickerId }));
+        if(props.toggleItemSelection){
+            props.toggleItemSelection(event, item, pickerId);
+        }
     },
 });