EVA
EVA

Reputation: 375

on ios7, <input type=date> is not shown in webview without default value

I use a UIWebview to display a html page. In the page, I has a date and time type, not datetime. But the field is not shown on ios7. It's ok on ios6. below is the css code:

div.answer-time-picker {
        padding: 10px 9px;
    }

    .answer-time-picker input {
        font-size: 17px;
        font-weight: normal;
        display: block;
        width: 100%;
        -webkit-box-sizing: border-box;
        border: none;
        -webkit-appearance: none;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    }

Is there anything wrong?

Thanks a lot!

update: I found that, if there is a default value, it will work fine. But if there is no value, it will not show the empty field. How can I enforce it to display the empty filed for user to click on it?

Upvotes: 2

Views: 3377

Answers (3)

Phuong Huynh
Phuong Huynh

Reputation: 23

See the reference here

Your CSS should be change as below:

{ 
align-items: center;
display: -webkit-inline-flex; 
overflow: hidden; 
padding: 0px; 
-webkit-padding-start: 1px; 
}

Upvotes: 1

EVA
EVA

Reputation: 375

I got some ideas from this quesiton:input type=date in iOS 7

I set a height in .answer-time-picker input. and it works!

Upvotes: 0

ColinE
ColinE

Reputation: 70160

It looks like this input type was removed in iOS 7

http://www.mobilexweb.com/blog/safari-ios7-html5-problems-apis-review

Following Google Chrome, now Safari on iOS doesn’t support the datetime input type anymore and it will fallback to text. This type was deprecated in the standard in favor of using two inputs, date and time for the same purpose. The problem is that datetime was compatible with iOS from version 5.0 to 6.1; if you are using it, be careful!

Upvotes: 2

Related Questions