Input type=date bug in mdb.js (iOS date picker not showing u

web
mobile

Topic: Input type=date bug in mdb.js (iOS date picker not showing up)

BenLevy pro asked 2 months ago

Sorry, I accidentally deleted the original question

Expected behavior iOS Date Picker keyboard should show up.

Actual behavior iOS text keyboard show up.

Resources (screenshots, code snippets etc.)

  <div class="md-form">
                            <label for="dob">Date Of Birth</label>
                            <input type="date" class="form-control" id="dob" value="2020-01-01" required>
                            <div class="invalid-feedback">
                                Date Of Birth is Required
                            </div>

                        </div>

This is causing the issue in mdb.js

{
            key: "ChangeDateInputType",
            value: function () {
                var e = t('input[type="date"]');
                e.each((function (t, e) {
                    e.type = "text"
                })), e.on("focus", (function (t) {
                    t.target.type = "date"
                })), e.on("blur", (function (e) {
                    e.target.type = "text", 0 === e.target.value.length && t("label[for=".concat(e.target.id, "]")).removeClass("active")
                }))
            }
        }

Grzegorz Bujański staff commented 2 months ago

Hi. Thanks for reporting this. I will add this to our to-do list.


jmgregory answered 4 weeks ago

I ran into this same issue, and I think it was because we had more than one script tag with mdbootstrap.js in our HTML. After I removed the duplicate script includes, the problem seems to have gone away. Perhaps extra event handlers were being added to the date input and causing a race condition with each other.


Grzegorz Bujański staff commented 4 weeks ago

Hi. I think the problem is somewhere else. We will deal with this soon.


Please insert min. 20 characters.
Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: jQuery
  • MDB Version: 4.13.0
  • Device: iOS (phone / ipad / etc)
  • Browser: Embedded UIWebView
  • OS: iOS (current)
  • Provided sample code: No
  • Provided link: No