Skip to content

Commit 8bdd5c5

Browse files
authored
Fix some filter input bugs (#779)
- The location filter input now updates reliably as you type. Previously, results would sometimes fail to display after typing because of buggy debounce logic (debouncing avoids sending every keystroke to Nominatim, which wouldn't be very polite). - When loading the filters page to edit an existing set of filters, the bbox or area filter that is currently set will be shown on the map. Previously, reloading the filters page would cause the map to be blank, even if an area filter was active. - Updates from react-select v1.0.0-rc.5 (released 2017-05-24) to v5.10.1 (the latest version, released 2025-03-03).
1 parent f87c9a8 commit 8bdd5c5

File tree

9 files changed

+562
-221
lines changed

9 files changed

+562
-221
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"@osmcha/osm-adiff-parser": "^3.0.0",
1818
"@turf/area": "^7.1.0",
1919
"@turf/bbox": "^7.1.0",
20+
"@turf/bbox-polygon": "^7.2.0",
2021
"@turf/simplify": "^7.1.0",
2122
"@turf/truncate": "^7.1.0",
2223
"animate.css": "^3.7.2",
@@ -41,7 +42,7 @@
4142
"react-router": "^4.1.1",
4243
"react-router-dom": "^4.1.1",
4344
"react-router-redux": "next",
44-
"react-select": "^1.0.0-rc.5",
45+
"react-select": "^5.10.1",
4546
"redux": "^3.7.2",
4647
"redux-devtools-extension": "^2.13.2",
4748
"redux-logger": "^3.0.6",

src/assets/index.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,11 @@ img {
503503
text-decoration: underline dotted !important;
504504
}
505505

506+
.react-select input:focus {
507+
/* assembly.js adds a focus (not focus-visible) style, which we remove since react-select has its own focus styles */
508+
box-shadow: none !important;
509+
}
510+
506511
table {
507512
width: 100%;
508513
}

src/components/filters/filters_list.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class FiltersList extends React.PureComponent<void, propsType, *> {
4040
display: f.display,
4141
value: this.props.filters.get(f.name),
4242
placeholder: f.placeholder,
43-
options: f.options || [],
43+
options: f.options,
4444
onChange: this.props.handleChange,
4545
dataURL: f.data_url,
4646
min: f.min,
@@ -65,7 +65,7 @@ class FiltersList extends React.PureComponent<void, propsType, *> {
6565
this.props.filters.has(f.name + '__lte')
6666
}
6767
>
68-
<span className="flex-parent flex-parent--row ">
68+
<span className="flex-parent flex-parent--row">
6969
<Text
7070
{...propsToSend}
7171
className="mr3"
@@ -224,7 +224,10 @@ class FiltersList extends React.PureComponent<void, propsType, *> {
224224
>
225225
<LocationSelect
226226
name="location"
227-
value=""
227+
value={
228+
this.props.filters.get('geometry') ||
229+
this.props.filters.get('in_bbox')
230+
}
228231
placeholder="Type a place name"
229232
onChange={this.props.handleChange}
230233
/>

0 commit comments

Comments
 (0)