examples icon indicating copy to clipboard operation
examples copied to clipboard

Floating labels not working in Parcel example

Open nkdas91 opened this issue 1 year ago • 0 comments

In Parcel example, Floating labels work only when I remove the following code from examples/parcel/node_modules/bootstrap/scss/forms/_floating-labels.scss

// Duplicated because `:-webkit-autofill` invalidates other selectors when grouped
> .form-control:-webkit-autofill {
  ~ label {
    opacity: $form-floating-label-opacity;
    transform: $form-floating-label-transform;
  }
}

Steps to reproduce the issue:

  1. In examples/parcel/src/scss/styles.scss, uncomment @import "bootstrap/scss/forms";
  2. Add floating labels example to examples/parcel/src/index.html
<div class="form-floating mb-3">
  <input type="email" class="form-control" id="floatingInput" placeholder="[email protected]">
  <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>
  1. npm install
  2. npm start (the label won't float when focused)
  3. Remove/Comment the above SCSS and it works

Not working on: Chrome 108.0.5359.71 (This version is outdated) on Ubuntu 16.04

Works on: Firefox on Ubuntu 16.04 and Chrome 112 on Windows 11

nkdas91 avatar Apr 14 '23 14:04 nkdas91