You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 📜 Description
Make `dismiss` method async to get rid off boilerplate/utilities
functions in main project.
## 💡 Motivation and Context
Originally this idea was suggested by @terrysahaidak. Before many
projects had its own implementation of this method. But @terrysahaidak
suggested and I agreed that it would be better to keep this method
directly inside the library.
## 📢 Changelog
<!-- High level overview of important changes -->
<!-- For example: fixed status bar manipulation; added new types
declarations; -->
<!-- If your changes don't affect one of platform/language below - then
remove this platform/language -->
### Docs
- include methods signature in methods description;
### JS
- changed mock implementation;
- make `dismiss` method async;
- create `module` file;
- set global listeners for `KeyboardEvents` inside `module` file;
## 🤔 How Has This Been Tested?
Tested on CI.
## 📝 Checklist
- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changed
This method is used to dynamically change the `windowSoftInputMode` (`softwareKeyboardLayoutMode` in Expo terminology) during runtime in an Android application. It takes an argument that specifies the desired input mode. The example provided sets the input mode to `SOFT_INPUT_ADJUST_RESIZE`:
26
30
27
31
```ts
@@ -38,6 +42,10 @@ A combination of `adjustResize` + `edge-to-edge` mode will result in behavior si
This method is used to restore the default `windowSoftInputMode` (`softwareKeyboardLayoutMode` in Expo terminology) declared in the `AndroidManifest.xml` (or `app.json` in Expo case). It resets the input mode to the default value:
This method is used to hide the keyboard. It triggers the dismissal of the keyboard:
57
+
```ts
58
+
staticdismiss(): Promise<void>;
59
+
```
60
+
61
+
This method is used to hide the keyboard. It triggers the dismissal of the keyboard. The method returns promise that will be resolved only when keyboard is fully hidden (if keyboard is already hidden it will resolve immediately):
50
62
51
63
```ts
52
-
KeyboardController.dismiss();
64
+
awaitKeyboardController.dismiss();
53
65
```
54
66
55
67
:::info What is the difference comparing to `react-native` implementation?
@@ -60,12 +72,16 @@ In contrast, the described method enables keyboard dismissal for any focused inp
0 commit comments