From 7f48ffeb7c2661b9588057cc341dd17cc2e19d12 Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Fri, 6 Jan 2023 11:36:23 +0100 Subject: [PATCH] just immediately go to the first match and do not show hard to dismiss dropdown --- app/src/frontend/map/search-box.tsx | 31 ++--------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/app/src/frontend/map/search-box.tsx b/app/src/frontend/map/search-box.tsx index 132b57a8..ac06984c 100644 --- a/app/src/frontend/map/search-box.tsx +++ b/app/src/frontend/map/search-box.tsx @@ -103,10 +103,7 @@ class SearchBox extends Component { apiGet(`/api/search?q=${this.state.q}`) .then((data) => { if (data && data.results){ - this.setState({ - results: data.results, - fetching: false - }); + this.props.onLocate(data.results[0].geometry.coordinates[1], data.results[0].geometry.coordinates[0], data.results[0].attributes.zoom) } else { console.error(data); @@ -157,31 +154,7 @@ class SearchBox extends Component { ); } - const resultsList = this.state.results.length? - - : null; + const resultsList = null; return (