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

Fixed edge cases for clearOnHide with nested forms + new test cases. #6068

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

travist
Copy link
Member

@travist travist commented Mar 26, 2025

Link to Jira Ticket

https://formio.atlassian.net/browse/FIO-XXXX

Description

There was previously a file that would perform all the tests for clearOnHide within the "test/unit" folder. This file was unfortunately not being executed because it did not have the "unit.js" extension. Once I enabled this file, it indicated a few edge cases where the clearOnHide functionality was not working within nested forms.

This also highlighted a few performance issues with the existing checks being made, as well as some legacy code that was checking the isEmpty() for nested forms, which caused major performance issues as it would iterate through all the children to check their emptiness... this was only being added to fix a bug with regards to customDefaultValues in nested forms.

Breaking Changes / Backwards Compatibility

None

Dependencies

None

How has this PR been tested?

New automated tests added.

Checklist:

  • I have completed the above PR template
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • My changes include tests that prove my fix is effective (or that my feature works as intended)
  • New and existing unit/integration tests pass locally with my changes
  • Any dependent changes have corresponding PRs that are listed above

@travist travist changed the title Fixed edge cases for clearOnHide with nested forms + new test cases. WIP: Fixed edge cases for clearOnHide with nested forms + new test cases. Mar 26, 2025
@travist travist changed the title WIP: Fixed edge cases for clearOnHide with nested forms + new test cases. Fixed edge cases for clearOnHide with nested forms + new test cases. Mar 26, 2025
@travist travist force-pushed the adding-clearonhide-fixes-and-tests branch from 9d9b428 to 050c9dd Compare March 27, 2025 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants