Skip to content

FIO-10201: fixed an issue where validation is triggered for components inside conditionally hidden editGrid#262

Merged
brendanbond merged 2 commits intomasterfrom
FIO-10201-fixed-required-validation-firing-for-field-inside-hidden-editGrid
Jun 10, 2025
Merged

FIO-10201: fixed an issue where validation is triggered for components inside conditionally hidden editGrid#262
brendanbond merged 2 commits intomasterfrom
FIO-10201-fixed-required-validation-firing-for-field-inside-hidden-editGrid

Conversation

@TanyaGashtold
Copy link
Copy Markdown
Contributor

@TanyaGashtold TanyaGashtold commented Jun 6, 2025

Link to Jira Ticket

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

Description

What changed?

The getComponentValue inside the simple conditionals check uses the getComponentFromPath that uses the eachComponentData. The eachComponentData resets the scope for each form component. The scope is needed for child components to define if parent is hidden or not. So, the child components of the conditionally hidden components are not considered to be hidden when scope is unavailable and the validation is triggered for them.
The getComponentValue (the same as getComponentFromPath) should not have any side affects. This PR makes the scope reset optional inside eachComponentData.

How has this PR been tested?

manually + tests

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

Copy link
Copy Markdown
Contributor

@brendanbond brendanbond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really love this, but I think we've painted ourselves into a bit of a corner on this. Ideally, eachComponent and eachComponentData just shouldn't have side effects at all.

@brendanbond brendanbond merged commit 4b3c6ef into master Jun 10, 2025
8 checks passed
lane-formio pushed a commit that referenced this pull request Jul 3, 2025
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.

2 participants