From 57ca36227bcc8b89e9820c2ba4be37fbe455676c Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Wed, 2 Aug 2023 17:54:22 +0200 Subject: [PATCH] fix clearing of contents of some input field when the tag is removed e.g. when using the trash can icon on the UI field --- CHANGELOG.md | 1 + modules/ui/fields/input.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2927eb39..8d72c3aa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ _Breaking developer changes, which may affect downstream projects or sites that * Fix sorting of nearby streets in address field dropdown * Fix bug where "outlink" buttons would not be disabled on invalid values of `identifier` fields * Fix zooming/panning in KartaView photo layer after resizing the panel ([#8997]) +* Fix clearing of contents of some input field when the respective tag is removed (e.g. when using the trash can icon on the UI field) #### :earth_asia: Localization #### :hourglass: Performance #### :mortar_board: Walkthrough / Help diff --git a/modules/ui/fields/input.js b/modules/ui/fields/input.js index 915c0c45a..92a62d302 100644 --- a/modules/ui/fields/input.js +++ b/modules/ui/fields/input.js @@ -472,7 +472,7 @@ export function uiFieldText(field, context) { const vals = getVals(tags); const isMixed = vals.size > 1; - var val = vals.size === 1 ? [...vals][0] : ''; + var val = vals.size === 1 ? [...vals][0] ?? '' : ''; var shouldUpdate; if (field.type === 'number' && val) {