6

Editing attributes in a formio form through the builder results in a number of changes -- fields are reordered apparently at random, and the "id" field gets a new value.

This is making it difficult to track actual form changes, since small changes result in very large diffs. Is there a reason for the reordering? And what is the use of the "id" field? Is it dependent (some sort of hash) on other values in the form component, or randomly generated

Modified "key" in components. I expected only "key" would be updated, but the order of attributes in the component changes, and there is a new value for "id" when I save the file.

Art Huston
  • 61
  • 1

1 Answers1

5

It seems the answer has already been given on GitHub:

We intentionally do not save Ids as they are not meant to be preserved. The reason for this is that there may be more than one of the same form on a webpage. If we store the ids as part of the component definition the two forms would use the same ids in the rendered components which would not be valid html. Instead, we generate new ids each time a component is instantiated and use the component key as the unique identifier.

Source: https://github.com/formio/formio.js/issues/2677#issuecomment-616614443

Also, related PR closed as "won't fix": https://github.com/formio/formio.js/pull/2154

ColdIV
  • 1,118
  • 2
  • 13
  • 21