Expose Webform conditional fields in a better way.

Created on 1 August 2022, over 2 years ago
Updated 7 February 2025, about 1 month ago

Problem/Motivation

Webform conditional fields should be exposed in a better way. I have attached a Screenshot of how the parent field is being referenced currently. Conditional fields should use a better way to expose parent elements.

Reference with these keys can be quite helpful:
parent_key, parent_type, parent_value.

Feature request
Status

Active

Version

4.0

Component

Code

Created by

🇮🇳India danishkshah

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Agreed, the way this is returned makes it very difficult to map to a headless frontend.

    {
      "#states": {
        "visible": {
          ".webform-submission-newsletter-add-form :input[name=\"country\"]": {
            "value": "AU"
          }
        }
      }
    }

    Theoretically you could parse .webform-submission-newsletter-add-form :input[name=\"country\"] but it's unfortunate that this is a CSS targeting rule instead of a more appropriate JSON structure nested under the field name.

Production build 0.71.5 2024