Because the child WKContentView can and does become first responder, WKWebView’s -becomeFirstResponder never gets called by UIKit. Similarly, because the WKWebView is never the first responder, its -resignFirstResponder is never called. This means that overrides of these methods in a WKWebView subclass normally don’t get called.
Created attachment 300776 [details] Make WKContentView’s -becomeFirstResponder and -resignFirstResponder forward to the WKWebView
Comment on attachment 300776 [details] Make WKContentView’s -becomeFirstResponder and -resignFirstResponder forward to the WKWebView View in context: https://bugs.webkit.org/attachment.cgi?id=300776&action=review > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:1017 > + if (currentContentView == _contentView && [_contentView superview]) usesStandardContentView? > Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:854 > + _becomingFirstResponder = YES; ScopedChange? or whatever we called it?
Fixed in <https://trac.webkit.org/r211770>.