Skip to content

Commit

Permalink
DBC22-1075: select first item on hitting enter/return
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-oxd committed Oct 27, 2023
1 parent bacb537 commit 6f6a17a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/frontend/src/Components/map/LocationSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ export default function LocationSearch(props) {
onSearch={loadLocationOptions}
options={options}
placeholder="Search for a location..."
highlightOnlyResult={true}
selectHint={(shouldSelect, e) => {
// Select the hint if the user hits 'enter'
return e.keyCode === 13 || shouldSelect;
}}
renderMenuItemChildren={location => (
<div>
<span>{location.properties.fullAddress}</span>
Expand Down

0 comments on commit 6f6a17a

Please sign in to comment.