From 11bcdbd7e3e76f38f87de1b3eaf5e20ea2377102 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 13 Aug 2021 17:28:40 +0530 Subject: [PATCH] hotfix for forms avoid browser fights when multiple authors view a form with a sortable list at the same time --- www/form/inner.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/www/form/inner.js b/www/form/inner.js index 410918787..1067146eb 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -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;