Skip to content

Commit eed7e01

Browse files
committed
wip
1 parent 9589d0f commit eed7e01

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

hwproj.front/src/components/Common/GroupSelector.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ interface GroupSelectorProps {
2424
}
2525

2626
const GroupSelector: FC<GroupSelectorProps> = (props) => {
27-
const groups = [{id: -1, name: ""}, {id: undefined, name: "Все студенты"}, ...(props.groups || []).filter(x => x.name)]
27+
const groups = [{id: -1, name: ""}, {
28+
id: undefined,
29+
name: "Все студенты"
30+
}, ...(props.groups || []).filter(x => x.name)]
2831
const selectedGroup = groups.find(g => g.id == props.selectedGroupId)
2932
const [formState, setFormState] = useState<{
3033
name: string,
@@ -90,7 +93,7 @@ const GroupSelector: FC<GroupSelectorProps> = (props) => {
9093
freeSolo={props.selectedGroupId != undefined}
9194
disableClearable={props.selectedGroupId == undefined}
9295
fullWidth
93-
options={[...groups]}
96+
options={props.selectedGroupId == undefined ? groups : []}
9497
renderOption={(props, option) => {
9598
if (option.id === -1)
9699
return <li {...props} style={{color: "#2979ff"}} key={option.id}>+ Добавить новую

0 commit comments

Comments
 (0)