X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/aed4e6256e6d5ecb5edc60a04a5aab6f04d9fb99..123bae90530147cf31e220066999b416d3610ae2:/src/views-components/project-tree-picker/project-tree-picker.tsx?ds=inline

diff --git a/src/views-components/project-tree-picker/project-tree-picker.tsx b/src/views-components/project-tree-picker/project-tree-picker.tsx
index 101fca08..bae5d59f 100644
--- a/src/views-components/project-tree-picker/project-tree-picker.tsx
+++ b/src/views-components/project-tree-picker/project-tree-picker.tsx
@@ -18,6 +18,7 @@ import { WrappedFieldProps } from 'redux-form';
 import { TreePickerId } from '~/models/tree';
 import { ProjectsTreePicker } from '~/views-components/projects-tree-picker/projects-tree-picker';
 import { ProjectsTreePickerItem } from '~/views-components/projects-tree-picker/generic-projects-tree-picker';
+import { PickerIdProp } from '~/store/tree-picker/picker-id';
 
 type ProjectTreePickerProps = Pick<TreePickerProps<ProjectResource>, 'onContextMenu' | 'toggleItemActive' | 'toggleItemOpen' | 'toggleItemSelection'>;
 
@@ -89,7 +90,7 @@ const renderTreeItem = (item: TreeItem<ProjectResource>) =>
         isActive={item.active}
         hasMargin={true} />;
 
-export const ProjectTreePickerField = (props: WrappedFieldProps & { pickerId: string }) =>
+export const ProjectTreePickerField = (props: WrappedFieldProps & PickerIdProp) =>
     <div style={{ height: '200px', display: 'flex', flexDirection: 'column' }}>
         <ProjectsTreePicker
             pickerId={props.pickerId}
@@ -102,6 +103,4 @@ export const ProjectTreePickerField = (props: WrappedFieldProps & { pickerId: st
 
 const handleChange = (props: WrappedFieldProps) =>
     (_: any, { id }: TreeItem<ProjectsTreePickerItem>) =>
-        props.input.value === id
-            ? props.input.onChange('')
-            : props.input.onChange(id);
+        props.input.onChange(id);
