Skip to content

Duplicate id in DOM for bootstrap 4 file field #40562

Closed
@theus77

Description

@theus77

Symfony version(s) affected: 4.x

Description
When using the boostrap 4 form template file fields have duplicate id in the DOM:

<div class="form-group">
    <label data-browse="Kiezen" for="form_asset" id="form_asset_label" placeholder="Bestand">Bestand</label>
    <div class="custom-file">
        <input aria-describedby="form_asset_help" class="file asset custom-file-input" id="form_asset" lang="nl" name="form[asset]" type="file">
        <label class="custom-file-label" data-browse="Kiezen" for="form_asset" id="form_asset_label" placeholder="Bestand"></label>
    </div>
</div>

How to reproduce
Just add a file field in a form using the bootstrap4 template

Possible Solution
I have a PR ready

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions