mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
restrict taginfo suggestions in raw tag editor to ones which match the input string
this additinoal filtering is needed because of the caching performed by the services/taginfo.js module.
This commit is contained in:
@@ -422,7 +422,9 @@ export function uiSectionRawTagEditor(id, context) {
|
||||
query: value
|
||||
}, function(err, data) {
|
||||
if (!err) {
|
||||
var filtered = data.filter(function(d) { return _tags[d.value] === undefined; });
|
||||
const filtered = data
|
||||
.filter(d => _tags[d.value] === undefined)
|
||||
.filter(d => d.value.toLowerCase().includes(value.toLowerCase()));
|
||||
callback(sort(value, filtered));
|
||||
}
|
||||
});
|
||||
@@ -436,7 +438,10 @@ export function uiSectionRawTagEditor(id, context) {
|
||||
geometry: geometry,
|
||||
query: value
|
||||
}, function(err, data) {
|
||||
if (!err) callback(sort(value, data));
|
||||
if (!err) {
|
||||
const filtered = data.filter(d => d.value.toLowerCase().includes(value.toLowerCase()));
|
||||
callback(sort(value, filtered));
|
||||
}
|
||||
});
|
||||
})
|
||||
.caseSensitive(allowUpperCaseTagValues.test(utilGetSetValue(key))));
|
||||
|
||||
Reference in New Issue
Block a user