Skip to content

raiseSoftKeyboard

Raises the on-screen keyboard with a real touch on a field, and confirms it came up.

Call it inside withSoftKeyboardEnabled — the device setting alone does not raise the keyboard, and this touch alone cannot while the setting suppresses it.

Call it with the keyboard DOWN. The first read is the baseline every later read is compared against, so a keyboard that is already up leaves the field nothing to lift by and this throws. That is the deliberate trade for working on a centred modal as well as a bottom-anchored one — see checkIsSoftKeyboardUp.

Import:

import { raiseSoftKeyboard } from 'obsidian-integration-testing';

Signature:

function raiseSoftKeyboard(params: RaiseSoftKeyboardParams): Promise<SoftKeyboardViewportSnapshot>

Parameters:

ParameterTypeDescription
paramsRaiseSoftKeyboardParamsThe device, the field to touch, and how far it must lift.

Returns: Promise<SoftKeyboardViewportSnapshot> — A Promise that resolves to the geometry read once the keyboard is up.


Links to this page: