Bug 214122 - REGRESSION (r259840): Pressing Esc or ⌘+"." does not dismiss time picker on iOS
Summary: REGRESSION (r259840): Pressing Esc or ⌘+"." does not dismiss time picker on iOS
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-07-08 21:58 PDT by Wenson Hsieh
Modified: 2020-07-09 12:46 PDT (History)
7 users (show)

See Also:


Attachments
Patch (14.99 KB, patch)
2020-07-09 11:59 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].