Skip to content

bugfix/FOUR-27646 First Financial Bank - Validation Rules for Hidden Required Fields Inside Loops Are Inconsistently Applied#1913

Open
gustavobascope wants to merge 1 commit into
developfrom
bugfix/FOUR-27646
Open

bugfix/FOUR-27646 First Financial Bank - Validation Rules for Hidden Required Fields Inside Loops Are Inconsistently Applied#1913
gustavobascope wants to merge 1 commit into
developfrom
bugfix/FOUR-27646

Conversation

@gustavobascope
Copy link
Copy Markdown
Contributor

Issue & Reproduction Steps

First Financial Bank - Validation Rules for Hidden Required Fields Inside Loops Are Inconsistently Applied

Expected behavior:
Hidden required fields should not be validated.
Validation should only apply to inputs that are visible and active at the time of submission.

Actual behavior:
When the screen loads, all three loop instances are created (because the default count is 3).
Even if the input fields are hidden (checkbox unchecked), the system still tries to validate them.
As a result:

Clicking Submit triggers “The field is required” errors for all hidden inputs.
If you check only the second or third checkbox and fill that input, the hidden ones still fail validation.
If you check and fill only the first input, the form submits successfully — even though the others remain hidden and empty.

This makes validation inconsistent depending on which iteration is visible or filled.

Solution

Added isVisible and insideLoop validation
image

How to Test

Create a new screen.

Add a Loop container loop_1.
Set Default Loop Count: 3

Inside loop_1, add:

A Checkbox form_checkbox_1.
A Required Line Input form_input_1.

For the Visibility Rule of form_input_1, set:

form_checkbox_1
(so the input only appears when the checkbox is checked).
Add a Submit button outside the loop.

In Preview mode:

Leave all checkboxes unchecked
Click Submit → all hidden required fields fail validation.
Check only the second or third checkbox and fill the input → hidden instances still fail validation.
Check and fill only the first instance → submission succeeds, even if other hidden fields exist.

Related Tickets & Packages

https://processmaker.atlassian.net/browse/FOUR-27646

@cypress
Copy link
Copy Markdown

cypress Bot commented Jun 1, 2026

screen-builder    Run #2261

Run Properties:  status check failed Failed #2261  •  git commit 96b9baabbb: bugfix/FOUR-27646 First Financial Bank - Validation Rules for Hidden Required Fi...
Project screen-builder
Branch Review bugfix/FOUR-27646
Run status status check failed Failed #2261
Run duration 09m 51s
Commit git commit 96b9baabbb: bugfix/FOUR-27646 First Financial Bank - Validation Rules for Hidden Required Fi...
Committer gustavobascope
View all properties for this run ↗︎

Test results
Tests that failed  Failures 2
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 19
Tests that did not run due to a failure in a mocha hook  Skipped 8
Tests that passed  Passing 379
View all changes introduced in this branch ↗︎

Tests for review

Failed  WatchersDragAndDrop.spec.js • 1 failed test • CI - Chrome

View Output

Test Artifacts
Watchers list Drag&Drop > should drag and drop first row to third row Test Replay Screenshots
Failed  ValidationRulesAdvanced.spec.js • 1 failed test • CI - Chrome

View Output

Test Artifacts
Validation Rules (Advanced test) > Verify all validation rules within loops Test Replay Screenshots

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.

1 participant