Validation of Hidden Fields Regression in 5.4.2

Open
#6,331 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
javascript
Domain
frontend

Research direction

Start by creating a minimal form in version 5.4.2 with AdvancedLogic set to show=false on a parent and a required child, then submit it to reproduce the validation. Compare the behavior with 5.4.1 and verify that hidden children are skipped when validateWhenHidden is false or omitted, while visible required fields still validate.

Written by the indexing model from the issue text.

Description

Describe the bug
We experience a regression in version 5.4.2:

Fields that have Required turned on, but are hidden by their parent components, are validated.
They should not be validated since they are hidden by none visible parent components.

In previous versions until 5.4.1 this used to work.

Version/Branch
5.4.2

To Reproduce
I will try to create an example form.
For now I just can report it.

Expected behavior
If a component is hidden by AdvancedLogic with show=false, the child components with required=true validation should not be validated on Form Submit.

These hidden fields should not validate if validateWhenHidden=false or if validateWhenHidden is omitted.

Dominant language
JavaScript
Stars
2.1k
Forks
1.1k
Avg merge
3d 8h
Merged PRs (30d)
1

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from formio/formio.js

All issues in formio/formio.js

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.