0

pretty new to Drupal. I've been using the Webforms module and have come across a troubling issue with interactions between the checkbox element, and the advanced_address and advanced_telephone webform elements.

If the advanced element has a condition to become disabled based on the checkbox value the whole page will become disabled when the condition is met. Does anyone have any tips also is it advisable to submit an issue ticket?

(Webform v6.2.7 Drupal v10.2.5).

to reproduce:

On any webform add both an advanced_address element and a checkbox element. Add the states condition on the advanced_address element:

disabled: ':input[name="checkbox_machine_name"]': checked: true

Here is a minimal example YAML config of a webform that has the issue:

test_page:
  '#type': wizard_page
  '#title': 'test page'
  checkbox:
    '#type': checkbox
    '#title': checkbox
  advanced_element:
    '#type': address
    '#title': 'advanced element'
    '#states':
      disabled:
        ':input[name="checkbox"]':
          checked: true
  extra_element_for_example:
    '#type': textfield
    '#title': 'extra element for example'
3
  • Could you export the YAML of a minimal form that shows the problem and include that in your post?
    – mona lisa
    Commented Sep 4 at 20:24
  • Added an example form. I just found out that this bug(?) only effects other elements in the same wizard page as the advanced element.
    – Keiji
    Commented Sep 5 at 12:56
  • Just to update if anyone else every happens to have this problem. 1: It appears that this is caused by some weird incompatibility between the Drupal core version that is being used and webforms as this problem doesn't appear to exist on Drupal 10.3.3. 2: I found a work around by wrapping the element in a "flexbox" layout with nothing else in it other than the advanced element. Doing this stopped everything else from being disabled.
    – Keiji
    Commented Sep 6 at 15:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.