Fix editing response with ordered list in forms

This commit is contained in:
yflory 2022-10-25 17:15:25 +02:00
parent 9c34e9e779
commit 614d3834a3
1 changed files with 8 additions and 2 deletions

View File

@ -2334,6 +2334,12 @@ define([
}
}
});
var sortNode = function (order) {
order.forEach(function (uid) {
$tag.append($tag.find('[data-id="'+uid+'"]'));
});
};
return {
tag: tag,
isEmpty: function () { return !this.getValue(); },
@ -2348,7 +2354,7 @@ define([
var toSort = extractValues(opts.values).map(function (val) {
return invMap[val];
});
sortable.sort(toSort);
sortNode(toSort);
reorder(true);
},
setEditable: function (state) {
@ -2365,7 +2371,7 @@ define([
var toSort = val.map(function (val) {
return invMap[val];
});
sortable.sort(toSort);
sortNode(toSort);
reorder();
}
};