---
name: "onKeyboardWillHide"
mode: "kit"
versionRequirements:
  - { name: "BaseKit", version: "3.6.6" }
platform:
  - "iOS"
  - "Android"
async: true
title: "onKeyboardWillHide - Keyboard hidden event"
---

## onKeyboardWillHide

> [VERSION] BaseKit >= 3.6.6

> [PLATFORM] iOS, Android

> ⚡ **Supports Promise** — Returns a Promise when success / fail / complete callbacks are omitted.

### Description

Keyboard message

### Parameters

`(listener: Function)`

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `listener` | `(params: KeyboardBeanRes) => void` | Yes | - | Event listener callback function |

### Referenced Types

##### `interface` KeyboardBeanRes

| Property | Type | Required | Since | Description |
| --- | --- | --- | --- | --- |
| `height` | `number` | Yes | `3.6.1` | Keyboard height |
| `keyBoardArea` | `KeyBoardArea` | Yes | `3.32.6` | Keyboard pop-up position |

##### `interface` KeyBoardArea

| Property | Type | Required | Since | Description |
| --- | --- | --- | --- | --- |
| `top` | `number` | Yes | `3.32.6` | Keyboard pop-up top position |
| `bottom` | `number` | Yes | `3.32.6` | Keyboard pop-up bottom position |
| `left` | `number` | Yes | `3.32.6` | Keyboard left position |
| `right` | `number` | Yes | `3.32.6` | Keyboard right position |


### Examples

```tsx
// Register the keyboard will-hide event + use scanCode's keyboard input mode to bring up and then hide the system keyboard.
// When scanCode is called with isShowKeyboard: true, the keyboard pops up automatically on the input page; tapping Back/Cancel exits the page and hides the keyboard, triggering onKeyboardWillHide.
ty.onKeyboardWillHide(e => {
  console.log("[onKeyboardWillHide]", e);
});

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