The core form element template generates a class of the form 'form-type-XXXX'. Radix generates this class with the 'js- prefix, but not without. Other contrib modules, such as webform, rely on the element-type class without the 'js-' prefix.

My work-around is to just add that class in my subtheme:

form-element.html.twig: 
{# Add form-type-webform-likert, for example #}
{% include "@radix/form/form-element.twig" with {
  attributes: attributes.addClass('form-type-' ~ type|clean_class),
} %}

I'm also wondering why there aren't utility classes available to be merged in this template as I see elsewhere. Seems a bit inconsistent but maybe there's a reason. It would have been nicer to just say utility_classes: ['form-type-' ~ type|clean_class]

Comments

DanChadwick created an issue. See original summary.

shreya_th’s picture

Assigned: Unassigned » shreya_th
shreya_th’s picture

Assigned: shreya_th » Unassigned
shubham_jain’s picture

Hi, what needs to be done here. Can you please explain.

  • doxigo committed 80b11ff3 on 5.1.x authored by DanChadwick
    Issue #3386839 by DanChadwick: Form element template missing form-type-...
doxigo’s picture

Status: Active » Fixed

Hey there Dan, thanks a lot for bringing this up

I am in the process of improving/fixing issues of all components and making it SDC compatible with a lot more features, I can't get enough sponsored time from my company, but I'll see what I can do

pretty much close to having an alpha release soon, I added this fix to 5.1.x and will also do so for 5.0.x

Also added the missing utility_classes feature

  • doxigo committed 82225189 on 5.0.x authored by DanChadwick
    Issue #3386839 by DanChadwick: Form element template missing form-type-...

Status: Fixed » Closed (fixed)

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