When a component that has a value is hidden by a conditional in the browser, its value should be considered empty, and should trigger any other conditionals that depend upon it.

Steps to reproduce lack of retriggering of condtionals

  1. Create components A, B, C
  2. Create conditional IF A=1 THEN SHOW B
  3. Create conditional IF B=1 THEN SHOW C
  4. Create submission.
  5. Set A=1, then B=1, then C=1
  6. Set A=empty. C should be hidden.

Related, this creates the possibility of an infinite recursion loop, which must be avoided to prevent browser errors. We don't prevent circular references, just warn about them.

Steps to reproduce recursion infinite loop:

  1. Create components A, B, and C
  2. Create a conditional: IF A=1 AND B=1 THEN SHOW C
  3. Create a conditional: IF C=1 THEN SHOW B
  4. Create a submission.
  5. Browser may already have a recursion depth error. If not, the set C to 1, causing B to appear. Set B to 1. Set A to 1, triggering the oscillating infinite loop.

Comments

danchadwick’s picture

Issue summary: View changes

  • DanChadwick committed 7b61e60 on 7.x-4.x
    Issue #2447745 by DanChadwick: Value of a hidden field should be empty...
  • DanChadwick committed bd1a691 on 8.x-4.x
    Issue #2447745 by DanChadwick: Value of a hidden field should be empty...
danchadwick’s picture

Issue summary: View changes
Status: Active » Fixed
StatusFileSize
new7.45 KB
danchadwick’s picture

Status: Fixed » Active

#4 does not handle fieldsets, where showing the target may show/hide many other fields within the fieldset.

danchadwick’s picture

Status: Active » Closed (duplicate)

Closing this as the solution for this will be addressed in the parent issue.