Skip to content

Commit

Permalink
psp-8718 correct behaviour of address search.
Browse files Browse the repository at this point in the history
  • Loading branch information
devinleighsmith committed Jul 3, 2024
1 parent b90f7c8 commit 02407d2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
left: 12.2rem;
}

.suggestionList option {
.suggestionList li {
padding: 1rem 0.5rem;
word-wrap: break-word;
width: 25rem;
Expand All @@ -27,7 +27,7 @@
color: var(--typography-color-secondary);

&:hover {
background-color: var(--typography-color-secondary-hover);
background-color: var(--surface-color-primary-button-hover);
color: #fff;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ export const GeocoderAutoComplete: React.FC<
}
if (options !== undefined) {
return (
<div className="suggestionList">
<ul className="suggestionList">
{options.map((x: IGeocoderResponse, index: number) => (
<option key={index} onClick={() => suggestionSelected(x)}>
<li key={index} onClick={() => suggestionSelected(x)}>
{x.fullAddress}
</option>
</li>
))}
</div>
</ul>
);
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ export const PropertyFilter: React.FC<React.PropsWithChildren<IPropertyFilterPro
placeholder="Enter an address"
onSelectionChanged={async val => {
const geocoderPidResponse = await getSitePids(val.siteId);
if (geocoderPidResponse?.pids?.length === 1) {
if (
geocoderPidResponse?.pids?.length === 1 &&
geocoderPidResponse?.pids[0] !== ''
) {
setFieldValue('pinOrPid', geocoderPidResponse?.pids[0]);
} else {
if (geocoderPidResponse?.pids?.length > 1) {
Expand Down

0 comments on commit 02407d2

Please sign in to comment.