Commits

Aleš Erjavec committed eacd96f

Compute the input list permutation from UUIDs only

Comments (0)

Files changed (1)

_textable/widgets/TextableUtils.py

             # the stored one
             inputs = widget.getdeepattr(self.inputListField.name)
             encoded = self.encode(inputs)
+            stored = context.values[self.inputListField.name]
+
+            def uuids(seq):
+                return [uuid for _, _, uuid in seq]
+            # NOTE: Match on widget uuids only.
+            # LTTL.Input.Input can change it's 'label' in place on user
+            # interaction.
+            permutation = self._permutation(uuids(encoded), uuids(stored))
+#             permutation = self._permutation(
+#                 encoded, context.values[self.inputListField.name])
 
-            permutation = self._permutation(
-                encoded, context.values[self.inputListField.name])
             permuted = [inputs[p] for p in permutation]
 
             # Restore the stored order in the widget.