Commit d2143617 authored by Zhou Fang's avatar Zhou Fang Committed by Martin Lowe
Browse files

added some comments

parent f4ee656c
......@@ -93,7 +93,10 @@ const WorkingGroup = ({ formik, fullWorkingGroupList, isLoading }) => {
option.value === value.value
}
getOptionDisabled={(option) => {
// disable all selected WGs
// getOptionDisabled need a boolen,
// so here we use !! for the result of array.find
// selectedWG will be true if the WG is already selected
// In this way, all selected WGs will be disabled
const selectedWG = !!formik.values.workingGroups.find(
(selectedWG) =>
selectedWG.workingGroup.label === option.label
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment