react-native-keyboard-controller 1.21.5 → 1.21.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/reactnativekeyboardcontroller/modules/KeyboardControllerModuleImpl.kt +11 -1
- package/android/src/main/java/com/reactnativekeyboardcontroller/views/ClippingScrollViewDecoratorView.kt +1 -1
- package/lib/commonjs/components/KeyboardChatScrollView/index.js +12 -2
- package/lib/commonjs/components/KeyboardChatScrollView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardChatScrollView/types.js.map +1 -1
- package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js +3 -3
- package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js.map +1 -1
- package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.js +4 -4
- package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/types.js.map +1 -1
- package/lib/commonjs/components/KeyboardChatScrollView/useEndVisible.js +40 -0
- package/lib/commonjs/components/KeyboardChatScrollView/useEndVisible.js.map +1 -0
- package/lib/commonjs/components/KeyboardChatScrollView/useExtraContentPadding/index.js +2 -2
- package/lib/commonjs/components/KeyboardChatScrollView/useExtraContentPadding/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardStickyView/index.js +10 -14
- package/lib/commonjs/components/KeyboardStickyView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/index.js +12 -3
- package/lib/commonjs/components/KeyboardToolbar/index.js.map +1 -1
- package/lib/commonjs/components/ScrollViewWithBottomPadding/index.js +35 -23
- package/lib/commonjs/components/ScrollViewWithBottomPadding/index.js.map +1 -1
- package/lib/commonjs/hooks/useKeyboardState/index.js +1 -7
- package/lib/commonjs/hooks/useKeyboardState/index.js.map +1 -1
- package/lib/commonjs/module.js +1 -1
- package/lib/commonjs/module.js.map +1 -1
- package/lib/module/components/KeyboardChatScrollView/index.js +12 -2
- package/lib/module/components/KeyboardChatScrollView/index.js.map +1 -1
- package/lib/module/components/KeyboardChatScrollView/types.js.map +1 -1
- package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js +3 -3
- package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js.map +1 -1
- package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.js +4 -4
- package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.js.map +1 -1
- package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/types.js.map +1 -1
- package/lib/module/components/KeyboardChatScrollView/useEndVisible.js +33 -0
- package/lib/module/components/KeyboardChatScrollView/useEndVisible.js.map +1 -0
- package/lib/module/components/KeyboardChatScrollView/useExtraContentPadding/index.js +2 -2
- package/lib/module/components/KeyboardChatScrollView/useExtraContentPadding/index.js.map +1 -1
- package/lib/module/components/KeyboardStickyView/index.js +11 -15
- package/lib/module/components/KeyboardStickyView/index.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/index.js +12 -3
- package/lib/module/components/KeyboardToolbar/index.js.map +1 -1
- package/lib/module/components/ScrollViewWithBottomPadding/index.js +37 -25
- package/lib/module/components/ScrollViewWithBottomPadding/index.js.map +1 -1
- package/lib/module/hooks/useKeyboardState/index.js +1 -7
- package/lib/module/hooks/useKeyboardState/index.js.map +1 -1
- package/lib/module/module.js +1 -1
- package/lib/module/module.js.map +1 -1
- package/lib/typescript/components/KeyboardChatScrollView/index.d.ts +3 -1
- package/lib/typescript/components/KeyboardChatScrollView/types.d.ts +26 -2
- package/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/types.d.ts +1 -1
- package/lib/typescript/components/KeyboardChatScrollView/useEndVisible.d.ts +17 -0
- package/lib/typescript/components/KeyboardChatScrollView/useExtraContentPadding/index.d.ts +1 -1
- package/lib/typescript/components/ScrollViewWithBottomPadding/index.d.ts +12 -0
- package/package.json +1 -1
- package/src/components/KeyboardChatScrollView/index.tsx +15 -2
- package/src/components/KeyboardChatScrollView/types.ts +29 -2
- package/src/components/KeyboardChatScrollView/useChatKeyboard/index.ios.ts +3 -3
- package/src/components/KeyboardChatScrollView/useChatKeyboard/index.ts +4 -4
- package/src/components/KeyboardChatScrollView/useChatKeyboard/types.ts +1 -1
- package/src/components/KeyboardChatScrollView/useEndVisible.ts +66 -0
- package/src/components/KeyboardChatScrollView/useExtraContentPadding/index.ts +3 -3
- package/src/components/KeyboardStickyView/index.tsx +18 -19
- package/src/components/KeyboardToolbar/index.tsx +13 -4
- package/src/components/ScrollViewWithBottomPadding/index.tsx +67 -28
- package/src/hooks/useKeyboardState/index.ts +1 -8
- package/src/module.ts +1 -1
|
@@ -5,7 +5,7 @@ import { KeyboardController } from "../../module";
|
|
|
5
5
|
|
|
6
6
|
import type { IKeyboardState } from "../../types";
|
|
7
7
|
|
|
8
|
-
const EVENTS = ["
|
|
8
|
+
const EVENTS = ["keyboardWillShow", "keyboardDidHide"] as const;
|
|
9
9
|
|
|
10
10
|
const getLatestState = () => ({
|
|
11
11
|
...KeyboardController.state(),
|
|
@@ -53,12 +53,6 @@ function useKeyboardState<T = IKeyboardState>(
|
|
|
53
53
|
setState(selector(getLatestState())),
|
|
54
54
|
),
|
|
55
55
|
);
|
|
56
|
-
// update `appearance` prematurely
|
|
57
|
-
const willShowSubscription = KeyboardEvents.addListener(
|
|
58
|
-
"keyboardWillShow",
|
|
59
|
-
(e) =>
|
|
60
|
-
setState(selector({ ...getLatestState(), appearance: e.appearance })),
|
|
61
|
-
);
|
|
62
56
|
|
|
63
57
|
// we might have missed an update between reading a value in render and
|
|
64
58
|
// `addListener` in this handler, so we set it here. If there was
|
|
@@ -67,7 +61,6 @@ function useKeyboardState<T = IKeyboardState>(
|
|
|
67
61
|
|
|
68
62
|
return () => {
|
|
69
63
|
subscriptions.forEach((subscription) => subscription.remove());
|
|
70
|
-
willShowSubscription.remove();
|
|
71
64
|
};
|
|
72
65
|
}, []);
|
|
73
66
|
|
package/src/module.ts
CHANGED