Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
fix dropdown button (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrund-tsi authored Oct 12, 2021
1 parent 483d16f commit b6675eb
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/components/modals/group-modal.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,16 @@ const GroupModal = (props: any) => {
for (const item of dropdownList) {
if (group.website.startsWith(item)) {
website = group.website.slice(item.length, group.website.length);
setSelectedDropdownValue(item);
}
}

setWebsiteValue(website);
}
else {
setWebsiteValue('');
setSelectedDropdownValue(dropdownList[0]);
}
}
setBtnOkDisabled(false);
}
Expand Down Expand Up @@ -163,7 +168,9 @@ const GroupModal = (props: any) => {
}
else {
setGroup({ ...emptyGroup });
setData('')
setSelectedDropdownValue(dropdownList[0]);
setData('');
setWebsiteValue('');
}
}

Expand Down Expand Up @@ -232,8 +239,16 @@ const GroupModal = (props: any) => {
}

const getDropdownItems = () => {
setDropdownItems(dropdownList.map((item: string) => <Dropdown.Item onSelect={(eventKey: any) => setSelectedDropdownValue(eventKey)}
eventKey={item}>{item}</Dropdown.Item>));
setDropdownItems(
dropdownList.map(
(item: string) =>
<Dropdown.Item
onSelect={(eventKey: any) => setSelectedDropdownValue(eventKey)}
eventKey={item}
key={item}
>
{item}
</Dropdown.Item>));
}

return (
Expand Down

0 comments on commit b6675eb

Please sign in to comment.