RESOLVED FIXED210230
Popovers are dismissed immediately when they try and bring up the keyboard.
https://bugs.webkit.org/show_bug.cgi?id=210230
Summary Popovers are dismissed immediately when they try and bring up the keyboard.
Megan Gardner
Reported 2020-04-08 17:32:02 PDT
Correctly retain focus when popovers employ keyboard
Attachments
Patch (4.94 KB, patch)
2020-04-08 17:36 PDT, Megan Gardner
no flags
Patch for landing (4.96 KB, patch)
2020-04-09 16:17 PDT, Megan Gardner
no flags
Megan Gardner
Comment 1 2020-04-08 17:36:58 PDT
Megan Gardner
Comment 2 2020-04-08 17:37:20 PDT
Darin Adler
Comment 3 2020-04-09 12:56:51 PDT
Comment on attachment 395890 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=395890&action=review Any way to make a test for this? > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:6669 > +- (void)preserveFocus > +{ > + [_webView _incrementFocusPreservationCount]; > +} > + > +- (void)releaseFocus > +{ > + [_webView _decrementFocusPreservationCount]; > +} Is there any risk that a WKContentView could be deallocated before releaseFocus is called, or have _webView set to null or any new value before this is called? Often, designs like this one can be dangerous if a stale count can be left behind. There are techniques to make them more resilient, like using objects and weak pointers, that are most costly but more foolproof. > Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm:341 > + if (_view.focusedElementInformation.elementType == InputType::Time || _view.focusedElementInformation.elementType == InputType::DateTimeLocal) > + [_view releaseFocus]; Maybe we could use a boolean _preservingFocus rather than repeating this check here. That way there’s no risk of the check in controlBeginEditing being out of sync with this one.
Megan Gardner
Comment 4 2020-04-09 16:17:45 PDT
Created attachment 396022 [details] Patch for landing
Darin Adler
Comment 5 2020-04-09 16:34:23 PDT
Comment on attachment 396022 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=396022&action=review > Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm:393 > + _preservingFocus = YES; > + [_view preserveFocus]; Could harden this slightly by wrapping this in: if (!_preservingFocus) { }
EWS
Comment 6 2020-04-09 16:58:55 PDT
Committed r259840: <https://trac.webkit.org/changeset/259840> All reviewed patches have been landed. Closing bug and clearing flags on attachment 396022 [details].
Note You need to log in before you can comment on or make changes to this bug.