From 46a2d6365f5609f66cfffe8d8b018516b82443d4 Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Fri, 21 Jul 2023 11:03:28 +0200 Subject: [PATCH] show tag reference info for the currently filled-in tag value, closes #9786 --- CHANGELOG.md | 2 ++ modules/ui/field.js | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e44772fe7..dd621a5303 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ _Breaking developer changes, which may affect downstream projects or sites that #### :tada: New Features #### :sparkles: Usability & Accessibility +* Show tag reference information for the currently filled-in tag value in UI fields (if available), instead of only showing the more generic _key_ documentation of the field ([#9786]) #### :scissors: Operations #### :camera: Street-Level #### :white_check_mark: Validation @@ -53,6 +54,7 @@ _Breaking developer changes, which may affect downstream projects or sites that #### :hammer: Development [#8997]: https://github.com/openstreetmap/iD/issues/8997 +[#9786]: https://github.com/openstreetmap/iD/issues/9786 # 2.26.2 diff --git a/modules/ui/field.js b/modules/ui/field.js index b75680d7fd..c7f0f2ca52 100644 --- a/modules/ui/field.js +++ b/modules/ui/field.js @@ -204,7 +204,11 @@ export function uiField(context, presetField, entityIDs, options) { referenceKey = referenceKey.replace(/:$/, ''); } - reference = uiTagReference(d.reference || { key: referenceKey }, context); + var referenceOptions = d.reference || { + key: referenceKey, + value: _tags[referenceKey] + }; + reference = uiTagReference(referenceOptions, context); if (_state === 'hover') { reference.showing(false); }