glhd / aire

Modern form builder for Laravel
https://airephp.com
MIT License
542 stars 36 forks source link

A way to use setAttribute() at the group level, rather than the element level? #121

Closed npw1982 closed 1 year ago

npw1982 commented 1 year ago

Is your feature request related to a problem? Please describe. When using Alpine x-show on an element, via the ->setAttribute() method. We can show and hide an input control, but this leaves the form group (e.g label) visible, is there a way to apply setAttribute() to the group instead of the input?

Describe the solution you'd like A parameter or separate method that applies the attribute to the parent instead of the input.

Describe alternatives you've considered Not using the autogrouping would get you part of the way there, but seems a shame to lose the autogrouping feature.

npw1982 commented 1 year ago

Or is there a way to access the child element attributes from the published group blade view that I am missing as ({{ $element }} is already html encoded in the group.blade.php)

inxilpro commented 1 year ago

Does the answer in https://github.com/glhd/aire/discussions/120 work?

npw1982 commented 1 year ago

It does thankyou, think that would be a really useful addition to the docs :) but its visible in the discussion now. Thanks very much for this!