| Summary: | [iOS] HTML datepicker's min-max attribute not working | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Kalpeshkumar Jain <kalpeshjain89> |
| Component: | Forms | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW --- | ||
| Severity: | Normal | CC: | ahmad.saleem792, akeerthi, cdumez, dvpdiner2, hello, karlcow, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Other | ||
| Hardware: | iPhone / iPad | ||
| OS: | iOS 14 | ||
|
Description
Kalpeshkumar Jain
2021-05-11 00:12:04 PDT
I changed the test from Comment 0 in below JSFiddle: https://jsfiddle.net/dkju3a5g/ I am unable to select 'future' date as expected behavior even in Safari 16.5. I think we can mark this as 'RESOLVED CONFIGURATION CHANGED'. Just wanted to get another opinion so will CC - Aditya & Karl to reconfirm my testing. This is still relevant on iOS. * macOS is working well and enforcing the max date * iOS still doesn't enforce the max date This seems to be due to the iOS date picker being a custom implementation through WKContentViewInteraction rather than implementing a WebDateTimePicker through the page client. My guess is because the iOS implementation predates the refactoring done to bring this to desktop platforms like macOS and GTK. https://github.com/WebKit/WebKit/blob/e004ae642c29d20e9684279124065f07a98883fb/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm#L990-L995 WKContentViewInteraction sets up the WKDateTimeInputControl based on the focusedElementInformation, which does not contain the min/max values. WebDateTimePicker is meant to get called with WebCore::DateTimeChooserParameters that provides all the values needed to set up the picker correctly. To further complicate the situation, the iOS side also has some special case handling for date/time pickers on watchOS that use a different UI library. I'd like to add that the macOS implementation does indeed not allow people to select a value outside of the range, visually it's impossible to see which is a valid date and which isn't. |