Skip to main content
Version: 3.x

Taro.onKeyboardHeightChange(callback)

Listens on the keyboard height changes

Reference

Type

(callback: Callback) => void

Parameters

Callback

(result: CallbackResult) => void
PropertyType
resultCallbackResult

CallbackResult

PropertyTypeDescription
heightnumberkeyboard height

Sample Code

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

API Support

APIWeChat Mini-ProgramH5React Native
Taro.onKeyboardHeightChange✔️✔️