title: Taro.onKeyboardHeightChange(callback)

sidebar_label: onKeyboardHeightChange

Listens on the keyboard height changes

Reference

Type

  1. (callback: Callback) => void

Parameters

Callback

  1. (result: CallbackResult) => void
Property Type
result CallbackResult

CallbackResult

Property Type Description
height number keyboard height

Sample Code

  1. Taro.onKeyboardHeightChange(res => {
  2. console.log(res.height)
  3. })

API Support

API WeChat Mini-Program H5 React Native
Taro.onKeyboardHeightChange ✔️ ✔️