Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 9be3171

Browse files
author
Vincent Voyer
committed
fix(dropdown): trim whitespace in locale name
fixes #65
1 parent 576758b commit 9be3171

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/createHitFormatter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function createHitFormatter({formatAutocompleteSuggestion, format
88
country: hit.country.default,
99
countryCode: findCountryCode(hit._tags),
1010
isCity: hit.is_city,
11-
name: hit.locale_names.default[0]
11+
name: hit.locale_names.default[0].trim() // trim should be done in data, waiting for a fix in Places API
1212
};
1313

1414
// this is the value to put inside the input.value
@@ -19,7 +19,7 @@ export default function createHitFormatter({formatAutocompleteSuggestion, format
1919
// this is the value shown in suggestions, we highlight the name
2020
formatted.suggestion = formatAutocompleteSuggestion({
2121
...formatted,
22-
name: hit._highlightResult.locale_names.default[0].value
22+
name: hit._highlightResult.locale_names.default[0].value.trim()
2323
});
2424

2525
return formatted;

0 commit comments

Comments
 (0)