From edf711ca2beed99c2fa431cc3a394fd9445acc20 Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Wed, 22 Jun 2022 14:57:58 +0200 Subject: [PATCH] fix rendering of chip labels in localizable multiCombo fields closes #9169 --- CHANGELOG.md | 2 ++ modules/ui/fields/combo.js | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd1948fec..417dd1d1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ _Breaking developer changes, which may affect downstream projects or sites that * Fix comments in notes overflowing when hovering ([#9074], thanks [@aaditya0000]) * Don't render `railway=platform_edge` like train tracks ([#9142], thanks [@k-yle]) * Fix leaking of localized tag values into raw tags by multiCombo fields ([#9164], thanks [@1ec5]) +* Fix localizable labels in multiCombo fields ("chips") being rendered multiple times ([#9169]) #### :rocket: Presets * Disable taginfo suggestions for the `via` field ([#9140], thanks [@k-yle]) * Treat `surface=chipseal` as a paved surface ([#9139], thanks [@k-yle]) @@ -73,6 +74,7 @@ _Breaking developer changes, which may affect downstream projects or sites that [#9142]: https://github.com/openstreetmap/iD/pull/9142 [#9157]: https://github.com/openstreetmap/iD/issues/9157 [#9164]: https://github.com/openstreetmap/iD/issues/9164 +[#9169]: https://github.com/openstreetmap/iD/issues/9169 [@furkanmutlu]: https://github.com/furkanmutlu [@JackNUMBER]: https://github.com/JackNUMBER [@aaditya0000]: https://github.com/aaditya0000 diff --git a/modules/ui/fields/combo.js b/modules/ui/fields/combo.js index 6f780c911..482332d44 100644 --- a/modules/ui/fields/combo.js +++ b/modules/ui/fields/combo.js @@ -546,10 +546,12 @@ export function uiFieldCombo(field, context) { } chips.select('span').each(function(d) { + const selection = d3_select(this); if (d.display) { - d.display(d3_select(this)); + selection.text(''); + d.display(selection); } else { - d3_select(this).text(d.value); + selection.text(d.value); } });