Skip to content

Commit

Permalink
fixed minLength parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
zdila committed May 24, 2023
1 parent 322b149 commit d83083e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ For examples without using bundler see `demo-maplibregl.html` or `demo-leaflet.h
- `errorMessage`: `string` - Override the default error message. Default `"Something went wrong…"`.
- `noResultsMessage`: `string` - Override the default message if no results are found. Default `"Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"`.
- `trackProximity`: `boolean` - If true, the geocoder proximity will automatically update based on the map view. Default `true`.
- `minLength`: `number` - Minimum number of characters to enter before results are shown. Default `2`.
- `minLength`: `number` - Minimum number of characters to enter for results to show. Default `2`.
- `bbox`: `[number, number, number, number]` - A bounding box argument: this is a bounding box given as an array in the format [minX, minY, maxX, maxY]. Search results will be limited to the bounding box.
- `language`: `string | string[]` - Specify the language(s) to use for response text and query result weighting. Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script. More than one value can also be specified, separated by commas. Set to empty string or empty array for forcing no language preference. If this parameter is not provided at all the browser's language settings will be used.
- `showResultsWhileTyping`: `boolean` - If `false`, indicates that search will only occur on enter key press. If `true`, indicates that the Geocoder will search on the input box being updated above the minLength option. Default `false`.
Expand Down
4 changes: 2 additions & 2 deletions src/lib/GeocodingControl.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
mapController.setMarkers(markedFeatures, picked);
}
$: if (!searchValue) {
$: if (searchValue.length < minLength) {
picked = undefined;
listFeatures = undefined;
error = undefined;
Expand Down Expand Up @@ -509,7 +509,7 @@
clearTimeout(searchTimeoutRef);
}
if (searchValue.length <= minLength) {
if (searchValue.length < minLength) {
return;
}
Expand Down

0 comments on commit d83083e

Please sign in to comment.