mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-23 16:49:40 +02:00
fix leaking of localized strings in combo fields when taginfo is unavailable
fixes #9342 and fall back to populate such fields with "static" options if taginfo service is offline
This commit is contained in:
@@ -141,8 +141,8 @@ export function uiFieldCombo(field, context) {
|
||||
|
||||
if (_showTagInfoSuggestions && services.taginfo) {
|
||||
selection.call(_combobox.fetcher(setTaginfoValues), attachTo);
|
||||
setStaticValues(); // pre-populate _combobox.data with static values
|
||||
setTaginfoValues('', setPlaceholder);
|
||||
|
||||
} else {
|
||||
selection.call(_combobox, attachTo);
|
||||
setStaticValues(setPlaceholder);
|
||||
@@ -189,7 +189,11 @@ export function uiFieldCombo(field, context) {
|
||||
}
|
||||
|
||||
services.taginfo[fn](params, function(err, data) {
|
||||
if (err) return;
|
||||
if (err) {
|
||||
// if service is unavailable: use static values (if any)
|
||||
setStaticValues(callback);
|
||||
return;
|
||||
}
|
||||
|
||||
data = data.filter(function(d) {
|
||||
// don't show the fallback value
|
||||
|
||||
Reference in New Issue
Block a user