This API is called using wx.updateKeyboard(Object object).
Property | Type | Default value | Required | Description |
value | string | - | True | The current value in the keyboard input box. |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |
This API is called using wx.showKeyboard(Object object).
Property | Type | Default value | Required | Description |
defaultValue | string | - | True | Default value displayed in the keyboard input box. |
maxLength | number | - | True | Maximum length of text in the keyboard. |
multiple | boolean | - | True | Whether the input is multiline. |
confirmHold | boolean | - | True | Whether the keyboard remains displayed when the user clicks Done. |
confirmType | string | - | True | The type of the Done button in the lower right corner of the keyboard. It only affects the text content of the button. |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |
Value | Description |
done | Complete |
next | Next |
search | Search |
go | Go |
send | Send |
This API is called using wx.onKeyboardInput(function listener).
Property | Type | Description |
value | string | The current value of the keyboard input. |
This API is called using wx.onKeyboardHeightChange(function listener).
Property | Type | Description |
height | number | Keyboard height. |
wx.onKeyboardHeightChange(res => {console.log(res.height)})
This API is called using wx.onKeyboardConfirm(function listener).
Property | Type | Description |
value | string | The current value of the keyboard input. |
This API is called using wx.onKeyboardComplete(function listener).
Property | Type | Description |
value | string | The current value of the keyboard input. |
The API is called using wx.offKeyboardInput(function listener).
const listener = function (res) { console.log(res) }wx.onKeyboardInput(listener)wx.offKeyboardInput(listener) // Must pass the same function object used in onKeyboardInput
This API is called using wx.offKeyboardHeightChange(function listener).
const listener = function (res) { console.log(res) }wx.onKeyboardHeightChange(listener)wx.offKeyboardHeightChange(listener) // Must pass the same function object used in onKeyboardHeight
This API is called using wx.offKeyboardConfirm(function listener).
const listener = function (res) { console.log(res) }wx.onKeyboardConfirm(listener)wx.offKeyboardConfirm(listener) // Must pass the same function object used in onKeyboardConfirm
This API is called using wx.offKeyboardComplete(function listener).
const listener = function (res) { console.log(res) }wx.onKeyboardComplete(listener)wx.offKeyboardComplete(listener) // Must pass the same function object used in onKeyboardComplete
This API is called using wx.hideKeyboard(Object object).
Property | Type | Default value | Required | Description |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |
wx.hideKeyboard({complete: res => {console.log('hideKeyboard res', res)}})