Repository: openstreetmap/iD (JavaScript)

Issue:
Don't suggest values from Taginfo for `name:xx` tags
### URL

_No response_

### How to reproduce the issue?

1. Create an element
2. Go to it's tags
3. Add `name:xx`
4. Switch to the value box
5. Start typing
6. (notice the suggestions below)

### Screenshot(s) or anything else?

![image](https://github.com/openstreetmap/iD/assets/19364673/39d43f9d-a943-4516-af9d-546ce684c9d4)


### Which deployed environments do you see the issue in?

Released version at openstreetmap.org/edit

### What version numbers does this issue effect?

2.29.0

### Which browsers are you seeing this problem on?

Firefox


Discussion: Related discussion: https://github.com/openstreetmap/iD/issues/7485.

There’s a hard-coded list of keys that don’t get taginfo suggestions. It could be supplemented by a regular expression for keys starting with `name:`.

https://github.com/openstreetmap/iD/blob/49492a0e06aef71f90e96ab3ed50098df0f4ce93/modules/services/taginfo.js#L196-L209
@1ec5 @Dimitar5555 can I start working on it if no one is doing it?? 
I don’t think anyone has submitted a pull request about this issue so far. (You’d see a link to it somewhere on this page.) Feel free to submit a PR once you’ve got something that you’d like feedback about, and we’ll try to respond when we’re able to.
By the way, I noted above that we’re hard-coding a list of “popular” keys to ignore, but there’s a large, technically unbounded number of possible `name:*` keys. So rather than trying to enumerate all of them, consider looking at where this `_popularKeys` variable is used and adjusting the logic there.
@1ec5 ok sir
hey @1ec5 i have done this issue and here the PR of this issue https://github.com/openstreetmap/iD/pull/10521 you can review that PR as soon as possible. 



Fix (patch):
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 38830ed22b..a278b0df9c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -38,6 +38,7 @@ _Breaking developer changes, which may affect downstream projects or sites that
 # unreleased (v2.37.0-dev)
 
 #### :sparkles: Usability & Accessibility
+* Don't suggest values from Taginfo for `name:xx` tags ([#10287], thanks [@draunger])
 #### :scissors: Operations
 #### :camera: Street-Level
 * Always hide sequence lines when their photos are hidden by the date filter ([#11365])
@@ -55,6 +56,7 @@ _Breaking developer changes, which may affect downstream projects or sites that
 #### :hammer: Development
 
 [#8400]: https://github.com/openstreetmap/iD/issues/8400
+[#10287]: https://github.com/openstreetmap/iD/issues/10287
 [#11141]: https://github.com/openstreetmap/iD/pull/11141
 [#11334]: https://github.com/openstreetmap/iD/pull/11334
 [#11353]: https://github.com/openstreetmap/iD/pull/11353
diff --git a/modules/services/taginfo.js b/modules/services/taginfo.js
index 16ca99f4d5..f5f79bff5f 100644
--- a/modules/services/taginfo.js
+++ b/modules/services/taginfo.js
@@ -11,6 +11,10 @@ import { taginfoApiUrl } from '../../config/id.js';
 var apibase = taginfoApiUrl;
 var _inflight = {};
 var _popularKeys = {};
+// manually exclude some additional keys – #5377, #7485, #10287
+// these will be returned by keys(), but taginfo will not be queried for values() requests
+var _extraExcludedKeys = /^(postal_code|via|((int_|loc_|nat_|official_|old_|ref_|reg_|short_|full_|sorting_|alt_|artist_|long_|bridge:|tunnel:)?name(:left|:right)?(:[a-z]+)?))$/;
+
 var _taginfoCache = {};
 
 var tag_sorts = {
@@ -195,20 +199,7 @@ export default {
     init: function() {
         _inflight = {};
         _taginfoCache = {};
-        _popularKeys = {
-            // manually exclude some keys – #5377, #7485
-            postal_code: true,
-            full_name: true,
-            loc_name: true,
-            reg_name: true,
-            short_name: true,
-            sorting_name: true,
-            artist_name: true,
-            nat_name: true,
-            long_name: true,
-            via: true,
-            'bridge:name': true
-        };
+        _popularKeys = [];
 
         // Fetch popular keys.  We'll exclude these from `values`
         // lookups because they stress taginfo, and they aren't likely
@@ -291,7 +282,7 @@ export default {
     values: function(params, callback) {
         // Exclude popular keys from values lookups.. see #3955
         var key = params.key;
-        if (key && _popularKeys[key]) {
+        if (key && _popularKeys[key] === true || _extraExcludedKeys.test(key)) {
             callback(null, []);
             return;
         }