This API is used via wx.onKeyboardHeightChange(function listener)
Attribute | Type | Description |
height | number | Keyboard Height |
wx.onKeyboardHeightChange(res => {console.log(res.height)})
This API is used via wx.hideKeyboard(Object object).
Attribute | Type | Default value | Required | Description |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
wx.hideKeyboard({complete: res => {console.log('hideKeyboard res', res)}})
This API is used via wx.offKeyboardHeightChange(function listener).
const listener = function (res) { console.log(res) }wx.onKeyboardHeightChange(listener)wx.offKeyboardHeightChange(listener) // The same function object as the listener must be passed in.
This API is used via wx.getSelectedTextRange(Object object).
Attribute | Type | Default value | Required | Description |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
Attribute | Type | Description |
start | number | Initial cursor position in the input field |
end | number | Final cursor position in the input field |
wx.getSelectedTextRange({complete: res => {console.log('getSelectedTextRange res', res.start, res.end)}})
Was this page helpful?