mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-31 20:21:36 +02:00
Filter out deprecated tag values from combobox suggestions (close #6084)
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
select as d3_select
|
||||
} from 'd3-selection';
|
||||
|
||||
import { osmEntity } from '../../osm/entity';
|
||||
import { t } from '../../util/locale';
|
||||
import { services } from '../../services';
|
||||
import { uiCombobox } from '../index';
|
||||
@@ -185,6 +186,15 @@ export function uiFieldCombo(field, context) {
|
||||
|
||||
taginfo[fn](params, function(err, data) {
|
||||
if (err) return;
|
||||
|
||||
var deprecatedValues = osmEntity.deprecatedTagValuesByKey()[field.key];
|
||||
if (deprecatedValues) {
|
||||
// don't suggest deprecated tag values
|
||||
data = data.filter(function(d) {
|
||||
return deprecatedValues.indexOf(d.value) === -1;
|
||||
});
|
||||
}
|
||||
|
||||
if (hasCountryPrefix) {
|
||||
data = data.filter(function(d) {
|
||||
return d.value.toLowerCase().indexOf(_country + ':') === 0;
|
||||
|
||||
Reference in New Issue
Block a user