Support from Acquia helps fund testing for Drupal Acquia logo

Comments

piggito created an issue. See original summary.

piggito’s picture

Status: Active » Needs review
FileSize
3.51 KB

Attaching patch to re-add the lines fixing the issue.

andypost’s picture

+++ b/webform.libraries.yml
@@ -660,6 +660,15 @@ webform.element.other:
+  dependencies:
+    - core/drupal
+    - core/jquery
+    - core/jquery.once

jquery.once already depends on jquery

andypost’s picture

piggito’s picture

FileSize
8.41 KB
5.53 KB

Removing core/jquery dependencies as suggested in #3

jrockowitz’s picture

Status: Needs review » Needs work

The webform.element.radios.js library was moved to webform.states.js

@see https://cgit.drupalcode.org/webform/tree/js/webform.states.js#n78

I did this so that all the #states API code was in one place. My mistake was removing the code to handle radios that are not conditionally required, which should stay in webform.element.radios.js. The code in webform.element.radios.js can be cleaned up and simplified to only handle radios that are not conditionally required.

Below is an example of radios that not conditionally required.

radios_required:
  '#type': radios
  '#title': radios_required
  '#required': true
  '#options': yes_no
jrockowitz’s picture

Status: Needs work » Needs review
FileSize
2.75 KB
6.3 KB

The attached patch was tested with the Bartik and Bootstrap theme.

jrockowitz’s picture

Darn. I just noticed my patch did not include any changes to webform.element.radios.js and removed this file.

jrockowitz’s picture

andypost’s picture

Minor nit - no reason to search all over whole DOM in context of behavior

Nice cleanup of deps!

jrockowitz’s picture

Great catch!!!

  • jrockowitz committed 5f5c7bd on 8.x-5.x authored by andypost
    Issue #2945890 by jrockowitz, piggito, andypost: Html required...
jrockowitz’s picture

Status: Needs review » Fixed

  • jrockowitz committed ff902eb on 8.x-5.x authored by andypost
    Issue #2945890 by jrockowitz, piggito, andypost: Html required...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.