Problem/Motivation

Fields hidden under a contingency field are erroneously "validated" on subsequent "show"

Steps to reproduce

Install

Installed clean (new) instance of Drupal 9
Installed Webform
Installed the clientside_validation module

Created a test form with 3 fields.

1. checkbox
2. number field
3. email

Configure

Under "conditional logic", configured the number field and the email field to be hidden unless the checkbox is checked
Under Clientside Validation jQuery Settings, enabled Validate on Blur/focusout

Error Repro

1. Click contingency field
2. View correctly displayed contingent fields (i.e., no validation error)
3. Click contingency field closed
4. Contingent fields correctly hidden
5. Click contingency field again (without reloading the form)
6. Contingent fields are marked as an error - failed validation.

Error

Proposed resolution

Do not trigger blur event when opening closing the parent contingency field. Subsequent opens should be the same as the first.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
client_side_error.jpg36.05 KBtmwagner

Comments

TMWagner created an issue. See original summary.

igoragatti’s picture

Version: 3.0.0-rc4 » 4.1.2

This issue continues in 4.1.2

Fields with conditions are being triggered. Even if in the initial condition they are visible.