show empty tag values in multi-selections

This commit is contained in:
Kyle Hensel
2023-11-25 21:48:54 +13:00
parent 407360943c
commit a876aa010c
3 changed files with 12 additions and 2 deletions

View File

@@ -725,6 +725,7 @@ en:
wiki_reference: View documentation
wiki_en_reference: View documentation in English
key_value: "key=value"
empty: (empty)
multiple_values: Multiple Values
multiple_types: Multiple Types
unshared_value_tooltip: not shared by all features

View File

@@ -403,7 +403,7 @@ export function uiCombobox(context, klass) {
if (d.display) {
d.display(d3_select(this));
} else {
d3_select(this).text(d.value);
d3_select(this).text(d.title);
}
})
.on('mouseenter', _mouseEnterHandler)

View File

@@ -411,7 +411,13 @@ export function uiSectionRawTagEditor(id, context) {
.fetcher(function(value, callback) {
var keyString = utilGetSetValue(key);
if (!_tags[keyString]) return;
var data = _tags[keyString].filter(Boolean).map(function(tagValue) {
var data = _tags[keyString].map(function(tagValue) {
if (!tagValue) {
return {
value: ' ',
title: t('inspector.empty'),
};
}
return {
value: tagValue,
title: tagValue
@@ -549,6 +555,9 @@ export function uiSectionRawTagEditor(id, context) {
// exit if this is a multiselection and no value was entered
if (typeof d.value !== 'string' && !this.value) return;
// remove tag if it is now empty
if (!this.value.trim()) return removeTag(d3_event, d);
// exit if we are currently about to delete this row anyway - #6366
if (_pendingChange && _pendingChange.hasOwnProperty(d.key) && _pendingChange[d.key] === undefined) return;