RESOLVED FIXED Bug 196272
[iOS] Should be able to dismiss picker or popover using the keyboard
https://bugs.webkit.org/show_bug.cgi?id=196272
Summary [iOS] Should be able to dismiss picker or popover using the keyboard
Daniel Bates
Reported 2019-03-26 14:57:13 PDT
Pressing the Escape key or Command + . should dismiss a picker or popover on iOS.
Attachments
Patch and layout test (38.19 KB, patch)
2019-03-26 21:15 PDT, Daniel Bates
no flags
Patch and layout test (37.97 KB, patch)
2019-03-28 11:06 PDT, Daniel Bates
no flags
Patch and layout test (38.00 KB, patch)
2019-03-28 11:19 PDT, Daniel Bates
no flags
Patch and layout test (37.93 KB, patch)
2019-03-28 15:28 PDT, Daniel Bates
no flags
Daniel Bates
Comment 1 2019-03-26 14:57:18 PDT
Daniel Bates
Comment 2 2019-03-26 21:15:21 PDT
Created attachment 366045 [details] Patch and layout test
Daniel Bates
Comment 3 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.
Daniel Bates
Comment 4 2019-03-28 11:06:46 PDT
Created attachment 366184 [details] Patch and layout test
Daniel Bates
Comment 5 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);
Daniel Bates
Comment 6 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);
Daniel Bates
Comment 7 2019-03-28 11:19:51 PDT
Created attachment 366186 [details] Patch and layout test
Daniel Bates
Comment 8 2019-03-28 15:28:23 PDT
Created attachment 366216 [details] Patch and layout test
WebKit Commit Bot
Comment 9 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>
WebKit Commit Bot
Comment 10 2019-04-03 10:06:13 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.