clearFocus method
Clears the current focus. On iOS and Android native WebView, it will clear also, for example, the current text selection.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - ViewGroup.clearFocus)
- iOS WKWebView (Official API - UIResponder.resignFirstResponder)
- macOS WKWebView (Official API - NSWindow.makeFirstResponder)
- Linux WPE WebKit (Official API - wpe_view_backend_remove_activity_state):
- Removes focused state from WPE backend and blurs active element via JavaScript
Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.
Implementation
Future<void> clearFocus() => platform.clearFocus();