Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormField::addFieldset setHtmlAttribute does nothing #6285

Open
evotodi opened this issue Apr 26, 2024 · 0 comments
Open

FormField::addFieldset setHtmlAttribute does nothing #6285

evotodi opened this issue Apr 26, 2024 · 0 comments

Comments

@evotodi
Copy link

evotodi commented Apr 26, 2024

When trying to add an html attribute to a filed set the attribute is not added.
Symfony: 7.0
Easyadmin: 4.9.4 and 4.10.0

To Reproduce
Add a fieldset with a html attribute using setHtmlAttribute

yield FormField::addFieldset('Static Network')->setHtmlAttribute('data-admin-vision-box-target', 'staticFieldSet')->addCssClass('evotodi');

Or using setFormTypeOptions

yield FormField::addFieldset('Static Network')->setFormTypeOptions(['attr' => ['data-admin-vision-box-target' => 'staticFieldSet']])->addCssClass('evotodi');

The addCssClass is there to easily find the fieldset and does work but does not effect the results.

Resulting html:

<div id="tab-networking" class="tab-pane field-form_tab active show" role="tabpanel" aria-labelledby="tablist-tab-networking">
  <div class="row">
    <div class="form-fieldset  field-form_fieldset evotodi">
      <fieldset>
        <div class="form-fieldset-header  ">
          <div class="form-fieldset-title">
            <span class="not-collapsible form-fieldset-title-content">Static Network</span>
         </div>
       </div>
       <div id="content-ea_form_fieldset_01HWDBH1GYEDD4CFM5Q3KB32Y7" class="form-fieldset-body   show">
         <div class="row">
             ...
         </div>
       </div>
     </fieldset>
   </div>
  </div>
</div>

Expected result:

...
<div class="form-fieldset  field-form_fieldset evotodi" data-admin-vision-box-target="staticFieldSet">
...

Adding a attribute to a tab does work as expected.
What am I missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant