Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing form submission between object types causes too many re-renders #93

Closed
saulipurhonen opened this issue Nov 10, 2020 · 3 comments · Fixed by #95
Closed

Changing form submission between object types causes too many re-renders #93

saulipurhonen opened this issue Nov 10, 2020 · 3 comments · Fixed by #95
Assignees
Labels
bug Something isn't working

Comments

@saulipurhonen
Copy link
Contributor

Describe the bug

If user moves between different object types form submission, you can see that the load times for forms are taking longer. This affects checking form status and can give false positives on isDirty. Might also be related to "clear form" action which doesn't seem to work right.

To Reproduce

Steps to reproduce the behaviour:

  1. Go to WizardFillObjectDetailsForm component
  2. In FormContent method log formschema
  3. Move between forms on different object types
  4. Console logs form schema multiple times

Expected behavior

Form should be rendered only once when object type changes.

@saulipurhonen saulipurhonen added the bug Something isn't working label Nov 10, 2020
@saulipurhonen saulipurhonen self-assigned this Nov 10, 2020
@saulipurhonen
Copy link
Contributor Author

Seems to be related to form resolver.

@saulipurhonen
Copy link
Contributor Author

It seems that if user navigates to xml upload between different object type form, resolver is fired only once. This might be fixed with nulling form data between object type change.

@saulipurhonen
Copy link
Contributor Author

saulipurhonen commented Nov 10, 2020

Fixed with destroying form component between changing object types. Form component is given a key (a random number at this point, should be more convenient). Component is destroyed when the key changes and therefore doesn't do unnecessary validations. This is going to be fixed when bugfix/prevent-draft-version-alert-popping-incorrectly is merged.

This improves performance by lot. Fixed form reset also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants