When removing a tag, remove it from _indexedKeys too

(re: d026f2f / #5927)

So that if the user decides to put it back, it will be sorted to the
end and not inserted back at its original position in the middle
This commit is contained in:
Bryan Housel
2019-05-01 19:17:59 -04:00
parent 382e0a7dd6
commit 087f252b18
+5
View File
@@ -361,7 +361,12 @@ export function uiRawTagEditor(context) {
if (d.key === '') { // removing the blank row
_showBlank = false;
content(wrap);
} else {
// remove from indexedKeys too, so that if the user puts it back,
// it will be sorted to the end and not back to its original position
_indexedKeys = _indexedKeys.filter(function(row) { return row.key !== d.key; });
_pendingChange = _pendingChange || {};
_pendingChange[d.key] = undefined;
scheduleChange();