twbs / twbs/bootstrap

FloatingLabels not working for input date or input time

Open
#39,257 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

css has-pr v5 v6
Dominant language
MDX
Stars
175k
Forks
78.6k
Avg merge
7h 19m
Merged PRs (30d)
35

Description

Prerequisites
Describe the issue

Unfortunately floatingLabels are not working on input date or input time fields.

Visually they look like a floatingLabel with a value already selected.

image

While there is no value selected, it is impossible for the user to determine, if the value 12:30 is a actual value or a placeholder.

Using Safari on OS X.

Thank you!

Reduced test cases

I am using React Bootstrap:

<Form.Group>
  <InputGroup>
    <FloatingLabel controlId="openingHours" label="Opening">
      <Form.Control className="left-icon icon-opened" type='time' placeholder='Test123' />
    </FloatingLabel>
    <FloatingLabel controlId="openingHours" label="Closing">
      <Form.Control className="left-icon icon-closed" type='time' placeholder='Test123' />
    </FloatingLabel>
  </InputGroup>
</Form.Group>

Producing this html:

<div>
  <div class="input-group">
    <div class="form-floating">
      <input placeholder="Test123" type="time" id="openingHours" class="left-icon icon-opened form-control">
    <label for="openingHours">Opening</label>
  </div>
  <div class="form-floating">
    <input placeholder="Test123" type="time" id="openingHours" class="left-icon icon-closed form-control">
      <label for="openingHours">Closing</label>
    </div>
  </div>
</div>
What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

Safari

What version of Bootstrap are you using?

5.3.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reduced HTML example and inspect Bootstrap's floating-label styling for date and time inputs in Safari on macOS. Compare empty and populated controls, and consider the issue resolved when an empty date or time field is visually distinguishable from one with a selected value.

Written by the indexing model from the issue text.

Assessment

Tech stack
bootstrap, css, html
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.