Merge pull request #10002 from k-yle/9876-multiple-values-empty

show empty tag values in multi-selections
This commit is contained in:
Martin Raifer
2023-12-06 14:18:31 +01:00
committed by GitHub
4 changed files with 21 additions and 1 deletions
+13 -1
View File
@@ -411,7 +411,16 @@ 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'),
display: selection => selection.text('')
.classed('virtual-option', true)
.call(t.append('inspector.empty'))
};
}
return {
value: tagValue,
title: tagValue
@@ -549,6 +558,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;