hotfix for forms

avoid browser fights when multiple authors view a form
with a sortable list at the same time
This commit is contained in:
ansuz 2021-08-13 17:28:40 +05:30
parent d8a7e4aa2a
commit 11bcdbd7e3
1 changed files with 10 additions and 1 deletions

View File

@ -1507,7 +1507,16 @@ define([
var map = {};
var invMap = {};
var sorted = false;
Util.shuffleArray(opts.values);
if (!APP.isEditor) {
/* There is probably a more reliable check for this, but if we always
shuffle the values then authors reorder the results in the data structure
every time they reload. If multiple authors are present then this leads
to fights over what the content should be, which tends to trick chainpad
into concatenating strings, which quickly turns the sortable list
into complete nonsense.
*/
Util.shuffleArray(opts.values); // XXX
}
var els = opts.values.map(function (data) {
var uid = Util.uid();
map[uid] = data;