onKeyboardHeightChange(listener: Function)

Requires:
BaseKit≥3.6.1@ray-js/ray≥1.5.30
Platforms:
iOSAndroid
import { onKeyboardHeightChange } from '@ray-js/ray';

// Promise usage
try {
  const res = await onKeyboardHeightChange({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

onKeyboardHeightChange sends keyboard events to JS

Parameters

ParameterTypeRequiredDescription
Yes

Return Value

None

Examples

import { onKeyboardHeightChange, scanCode } from '@ray-js/ray'

// Register the keyboard height change event and use scanCode's keyboard input mode to bring up the system keyboard.
// Passing isShowKeyboard: true to scanCode provides a "Keyboard input" entry on the scan page; after entering, the input field auto-focuses to show the system keyboard, and keyboard height changes trigger onKeyboardHeightChange.
onKeyboardHeightChange(e => {
  console.log("[onKeyboardHeightChange]", e);
});

scanCode({
  onlyFromCamera: false,
  isShowKeyboard: true,
  keyboardBean: { title: "Keyboard input" },
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});