Skip to content

Commit 166f05a

Browse files
committed
GD-130: Update React-Geocoder-Autocomplete to support new options
*Fixing useEffect for addFilterByPlace() *Fix the title of the demo *Fixing design of Events Demo -> Console output *Enable lazy loading in Events Demo (to load more places when scrolling) *Fix autocomplete properties for Address Form Demo
1 parent 50cae43 commit 166f05a

6 files changed

Lines changed: 35 additions & 26 deletions

File tree

example/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
work correctly both with client-side routing and a non-root public URL.
2828
Learn how to configure a non-root public URL by running `npm run build`.
2929
-->
30-
<title>react-geocoder-autocomplete</title>
30+
<title>React Geocoder Autocomplete - Demo Collection</title>
3131
</head>
3232

3333
<body>

example/public/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"short_name": "react-geocoder-autocomplete",
3-
"name": "react-geocoder-autocomplete",
2+
"short_name": "React Geocoder",
3+
"name": "React Geocoder Autocomplete Demo",
44
"icons": [
55
{
66
"src": "favicon.ico",

example/src/components/AddressFormDemo.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,12 @@ const AddressFormDemo = () => {
244244
</div>
245245
<div className="autocomplete-container">
246246
<GeoapifyGeocoderAutocomplete
247-
placeholder="Start typing an address…"
247+
allowNonVerifiedHouseNumber={true}
248+
allowNonVerifiedStreet={true}
249+
skipIcons={true}
250+
placeholder=" "
251+
skipSelectionOnArrowKey={true}
248252
placeSelect={onAddressSelected}
249-
addDetails={true}
250253
/>
251254
<p className="search-hint">
252255
Use search to start. We'll prefill; you review and complete. Can't find your exact address? <a href="#" onClick={handleEnterManually}>Enter it manually</a>.

example/src/components/EventsShowcaseDemo.css

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -106,41 +106,46 @@
106106
}
107107

108108
.console {
109-
background: #1e1e1e;
110-
color: #d4d4d4;
111-
padding: 15px;
109+
background: #0b1526;
110+
color: #d7e3ef;
111+
padding: 10px;
112112
border-radius: 8px;
113-
font-family: 'Courier New', Courier, monospace;
114-
font-size: 13px;
115-
max-height: 500px;
116-
overflow-y: auto;
113+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
114+
font-size: 12px;
115+
max-height: 380px;
116+
overflow: auto;
117117
line-height: 1.6;
118+
border: 1px solid #152238;
118119
}
119120

120121
.console .line {
121-
display: flex;
122-
gap: 12px;
123-
margin-bottom: 8px;
124-
padding: 4px 0;
125-
border-bottom: 1px solid #2d2d2d;
122+
white-space: pre-wrap;
123+
border-bottom: 1px dashed rgba(255,255,255,0.06);
124+
padding: 6px 4px;
125+
}
126+
127+
.console .line:last-child {
128+
border-bottom: none;
126129
}
127130

128131
.console .ts {
129-
color: #858585;
130-
min-width: 100px;
131-
font-weight: 600;
132+
color: #8fb1d1;
133+
margin-right: 8px;
132134
}
133135

134136
.console .evt {
135-
color: #4ec9b0;
136-
min-width: 220px;
137+
display: inline-block;
138+
background: #12243a;
139+
color: #a3c7ff;
140+
border: 1px solid #223955;
141+
border-radius: 6px;
142+
padding: 2px 6px;
143+
margin-right: 8px;
137144
font-weight: 600;
138145
}
139146

140147
.console .payload {
141-
color: #ce9178;
142-
flex: 1;
143-
word-break: break-word;
148+
color: #cfe5ff;
144149
}
145150

146151
.empty-console {

example/src/components/EventsShowcaseDemo.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ const EventsShowcaseDemo = () => {
194194
<GeoapifyGeocoderAutocomplete
195195
showPlacesByCategoryList={true}
196196
enablePlacesByCategoryLazyLoading={true}
197+
placesByCategoryLimit={10}
197198
limit={8}
198199
hidePlacesByCategoryListAfterSelect={true}
199200
skipIcons={false}

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ export const GeoapifyGeocoderAutocomplete = ({
439439
filterByPlaceValue as string
440440
);
441441
}
442-
}, [filterByRectValue]);
442+
}, [filterByPlaceValue]);
443443

444444
useEffect(() => {
445445
if (geocoderAutocomplete.current) {

0 commit comments

Comments
 (0)