Open
Description
Floating labels don't display correctly if they're used with an input group, i.e. if prepend:
or append:
are set.
f.text_field :name, floating: true, prepend: "My name is"
Generates:
<div class="mb-3 form-floating">
<div class="input-group">
<span class="input-group-text">My name is</span>
<input class="form-control" placeholder="Name" type="text" value="" name="person[name]" id="person_name">
</div>
<label class="form-label" for="person_name">Name</label>
</div>
To work, I think there should only be one wrapper element, and the label should be placed alongside the input, i.e.:
<div class="mb-3 form-floating input-group">
<span class="input-group-text">My name is</span>
<input class="form-control" placeholder="Name" type="text" value="" name="person[name]" id="person_name">
<label class="form-label" for="person_name">Name</label>
</div>
Metadata
Metadata
Assignees
Labels
No labels