Bug 214122

Summary: REGRESSION (r259840): Pressing Esc or ⌘+"." does not dismiss time picker on iOS
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: FormsAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, cdumez, hi, megan_gardner, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Wenson Hsieh 2020-07-08 21:58:18 PDT
<rdar://problem/64940487>
Comment 1 Wenson Hsieh 2020-07-09 11:59:39 PDT
Created attachment 403898 [details]
Patch
Comment 2 Tim Horton 2020-07-09 12:16:53 PDT
Comment on attachment 403898 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=403898&action=review

> Source/WebKit/UIProcess/ios/forms/WKDateTimeInputControl.mm:379
> +    if (elementType == InputType::Time || elementType == InputType::DateTimeLocal)

I know this was already here... but is there a better way to know or infer the right set of types, instead of keeping a list here?
Comment 3 Wenson Hsieh 2020-07-09 12:33:01 PDT
Comment on attachment 403898 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=403898&action=review

Thanks for the review!

>> Source/WebKit/UIProcess/ios/forms/WKDateTimeInputControl.mm:379
>> +    if (elementType == InputType::Time || elementType == InputType::DateTimeLocal)
> 
> I know this was already here... but is there a better way to know or infer the right set of types, instead of keeping a list here?

That’s a good question. I don’t think there’s a way to know without poking around in UIKit internals, because the thing that actually steals FR in these controls is _UIDatePickerCalendarTimeLabel (an internal class).

I think we could maybe make this consult -[UIDatePicker datePickerMode] and -[UIDatePicker datePickerStyle] instead, but the logic would look pretty similar to what we have already.
Comment 4 Tim Horton 2020-07-09 12:39:59 PDT
Maybe in the distant future we could ask UIKit to vend an explicit bit for this.
Comment 5 Wenson Hsieh 2020-07-09 12:43:43 PDT
Comment on attachment 403898 [details]
Patch

(In reply to Tim Horton from comment #4)
> Maybe in the distant future we could ask UIKit to vend an explicit bit for
> this.

👍🏻
Comment 6 EWS 2020-07-09 12:46:14 PDT
Committed r264187: <https://trac.webkit.org/changeset/264187>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 403898 [details].