django-bootstrap3 icon indicating copy to clipboard operation
django-bootstrap3 copied to clipboard

cannot create floating labels

Open hayate opened this issue 3 years ago • 2 comments

It seems impossible to create a bootstrap form with floating labels as shown below because:

  1. when using the bootstrap_field tag only, the label is rendered before the input tag, this breaks floating labels
  2. when using separate bootstrap_field and bootstrap_label tags, the input field is wrapped in a div that breaks floating labels.
<div class="form-floating mb-3">
  <input type="email" class="form-control" id="floatingInput" placeholder="Username">
  <label for="floatingInput">Email address</label>
</div>
<div class="form-floating">
  <input type="password" class="form-control" id="floatingPassword" placeholder="Password">
  <label for="floatingPassword">Password</label>
</div>

hayate avatar Dec 21 '21 03:12 hayate

@hayate Hi I think floating labels is from bootstrap 5, right?

CleitonDeLima avatar Dec 21 '21 13:12 CleitonDeLima

@CleitonDeLima sorry for the late reply. I am not sure, I rarely venture into the front-end. It's possible that they were not in the previous version of bootstrap.

hayate avatar Jan 06 '22 07:01 hayate

No further changes are expected on this project. See README.md (#964 ).

dyve avatar Apr 16 '24 19:04 dyve