Fixed #868 For Owner already set to a team, "Select owner" list should open with teams tab as active. (#870)

This commit is contained in:
Sachin Chaurasiya 2021-10-20 11:35:23 +05:30 committed by GitHub
parent 3c21edbe75
commit 047c70bc25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,6 +70,15 @@ const DropDownList: FunctionComponent<DropDownListProp> = ({
);
};
const setCurrentTabOnMount = () => {
const owner = dropDownList.find((l) => l.value === value);
if (owner) {
const index = listGroups.indexOf(owner.group as string);
setActiveTab(index >= 0 ? index + 1 : 1);
}
};
useEffect(() => {
setSearchText(searchString);
}, [searchString]);
@ -100,6 +109,7 @@ const DropDownList: FunctionComponent<DropDownListProp> = ({
useEffect(() => {
isMounted.current = true;
setCurrentTabOnMount();
}, []);
return (