question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Date Input has incorrect sizing in Safari

See original GitHub issue

In Safari 14.1 (on macOS Big Sur) the following will render ‘incorrectly’ on Safari - the date input element is over-sized.

The issue isn’t related to having another column or another field - but having a regular text input helps to highlight the sizing bug.

FF seems to render it correctly.

<div class="container">
<div class="row g-3">
  <div class="col">
    <input type="text" class="form-control" placeholder="First name" aria-label="First name">
  </div>
  <div class="col">
    <input type="date" class="form-control"">
  </div>
</div>
</div>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
javierarterocommented, Aug 31, 2022

This can be fixed from the webkit pseudo-element ::-webkit-datetime-edit

input::-webkit-datetime-edit {
  display: block;
  padding: 0;
}
1reaction
stephenreaycommented, Feb 9, 2022

Doing some digging, the trigger for this is the display: block rule on the input element.

I’ve filed a webkit bug about this: https://bugs.webkit.org/show_bug.cgi?id=236352

Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS safari messes up input type=date - Stack Overflow
The problem hereby is the size of the field: Using Bootstrap v3.2 for the design, these inputs are in a form and have...
Read more >
SwiftUI Date Picker is Problematic | Apple Developer Forums
The date format is getting changed with specific dates and not everytime i select a new one. BUT, I found a workaround. You...
Read more >
<input type="date"> - HTML: HyperText Markup Language
This code finds the first <input> element whose type is date , and sets its value to 2017-06-01 (June 1st, 2017).
Read more >
Safari 14.1 comes with date input type support : r/webdev
Anyone know what to look for as to why my hamburger icon doesn't show up on Safari, but works fine on literally everything...
Read more >
Date input height in Safari | H.W. Sanden
input type="date" in Safari renders an input much taller than others. Why not let it render like other inputs? The reasons are unknown....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found