Skip to content

Commit

Permalink
fix: select forest type only when clicking on select option
Browse files Browse the repository at this point in the history
  • Loading branch information
friedjoff committed Oct 2, 2020
1 parent 459cea2 commit 6a257a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
10 changes: 2 additions & 8 deletions src/components/ForestTypeModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,8 @@ function ForestTypeModal({ data, setIsForestTypeModalOpen }) {
{data.la ? <i>{data.la}</i> : null}
</Modal.Header>
}
onClose={(e) => {
e.stopPropagation();
setIsForestTypeModalOpen(false);
}}
onOpen={(e) => {
e.stopPropagation();
setIsForestTypeModalOpen(true);
}}
onClose={(e) => setIsForestTypeModalOpen(false)}
onOpen={(e) => setIsForestTypeModalOpen(true)}
trigger={<Button active icon="info" />}
/>
);
Expand Down
8 changes: 5 additions & 3 deletions src/components/LocationResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ function LocationResult() {
}
key={key}
value={key}
onClick={(e, { value: forestType }) =>
selectForestType(forestType)
}
onClick={(e, { value: forestType }) => {
if (e.target.getAttribute('role') === 'option') {
selectForestType(forestType);
}
}}
/>
);
})}
Expand Down

0 comments on commit 6a257a6

Please sign in to comment.