Skip to content

keyboardDisplayRequiresUserAction()

function keyboardDisplayRequiresUserAction(required): 
  | HookExtension
  | null;

iOS

With required false, a page script's focus() on an input shows the keyboard, as a tap does: react-native-webview's keyboardDisplayRequiresUserAction.

A change applies from the next focus. Without this extension, WebKit's own rules show the keyboard only for some focuses, such as one in a tap's handler.

It has no effect from iOS 27: WebKit there tells the app of a script's focus only while the WebView has focus, such as after a touch, and then shows the keyboard itself.

It replaces a private WebKit method, as react-native-webview does, so a WebKit update can stop it working.

Parameters

Parameter Type
required boolean

Returns

| HookExtension | null

Null when required is true, WebKit's default, and on Android.