Bug 196272 - [iOS] Should be able to dismiss picker or popover using the keyboard
Summary: [iOS] Should be able to dismiss picker or popover using the keyboard
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Local Build
Hardware: iPhone / iPad iOS 12
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar, PlatformOnly
Depends on:
Blocks: 190571 195819 196360
  Show dependency treegraph
 
Reported: 2019-03-26 14:57 PDT by Daniel Bates
Modified: 2019-04-03 10:06 PDT (History)
6 users (show)

See Also:


Attachments
Patch and layout test (38.19 KB, patch)
2019-03-26 21:15 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff
Patch and layout test (37.97 KB, patch)
2019-03-28 11:06 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff
Patch and layout test (38.00 KB, patch)
2019-03-28 11:19 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff
Patch and layout test (37.93 KB, patch)
2019-03-28 15:28 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2019-03-26 14:57:13 PDT
Pressing the Escape key or Command + . should dismiss a picker or popover on iOS.
Comment 1 Daniel Bates 2019-03-26 14:57:18 PDT
<rdar://problem/48943170>
Comment 2 Daniel Bates 2019-03-26 21:15:21 PDT
Created attachment 366045 [details]
Patch and layout test
Comment 3 Daniel Bates 2019-03-28 10:36:49 PDT
Comment on attachment 366045 [details]
Patch and layout test

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

> Source/WebKit/UIProcess/ios/forms/WKFormPeripheralBase.mm:75
> +    UIPhysicalKeyboardEvent *keyEvent = (UIPhysicalKeyboardEvent *)event;

AccessoryDone can be called multiple times. Doesn't cause an issue, but would be better to only call it once. Moreover, control may want want to distinguish between key events when its UI is presented vs key events when its UI is not on screen (e.g. <select> still supports typeahead and arrow keys even when its picker/popover is not on screen). To support this, will add @property (nonatomic, readonly) editing; <--- kinda don't like this name, went with it to match naming of beginEditing and endEditing and since I toggle YES/NO for _editing in these functions. We will early return before this line if !_editing.
Comment 4 Daniel Bates 2019-03-28 11:06:46 PDT
Created attachment 366184 [details]
Patch and layout test
Comment 5 Daniel Bates 2019-03-28 11:14:32 PDT
Comment on attachment 366184 [details]
Patch and layout test

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

> LayoutTests/fast/forms/ios/dismiss-picker-using-keyboard.html:72
> +            UIHelper.keyDown("escape");

This should be:

UIHelper.keyDown(keyCommand.key, modifiers=keyCommand.modifiers);
Comment 6 Daniel Bates 2019-03-28 11:17:47 PDT
(In reply to Daniel Bates from comment #5)
> Comment on attachment 366184 [details]
> Patch and layout test
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=366184&action=review
> 
> > LayoutTests/fast/forms/ios/dismiss-picker-using-keyboard.html:72
> > +            UIHelper.keyDown("escape");
> 
> This should be:
> 
> UIHelper.keyDown(keyCommand.key, modifiers=keyCommand.modifiers);

Python on the 🧠. Not likely valid JS, yet:

UIHelper.keyDown(keyCommand.key, keyCommand.modifiers);
Comment 7 Daniel Bates 2019-03-28 11:19:51 PDT
Created attachment 366186 [details]
Patch and layout test
Comment 8 Daniel Bates 2019-03-28 15:28:23 PDT
Created attachment 366216 [details]
Patch and layout test
Comment 9 WebKit Commit Bot 2019-04-03 10:06:11 PDT
Comment on attachment 366216 [details]
Patch and layout test

Clearing flags on attachment: 366216

Committed r243808: <https://trac.webkit.org/changeset/243808>
Comment 10 WebKit Commit Bot 2019-04-03 10:06:13 PDT
All reviewed patches have been landed.  Closing bug.