Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/eighty-planets-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@react-native-ama/extras': patch
---

Updated useKeyboard hook argument shouldHandleKeyboardEvents to default to true and not be required.
6 changes: 3 additions & 3 deletions packages/extras/src/hooks/useKeyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ const KEYBOARD_EVENT_HIDE: KeyboardEventName = Platform.select({
default: 'keyboardDidHide',
});

export const useKeyboard = (shouldHandleKeyboardEvents: boolean) => {
export const useKeyboard = (shouldHandleKeyboardEvents: boolean = true) => {
const keyboardHeight = useSharedValue(0);
const keyboardFinalHeight = useSharedValue(0);
const isKeyboardVisible = useSharedValue(false);

const handleKeyboardEvent = useCallback(
(
isVisible: boolean,
height: number,
endCoordinatesHeight: number,
duration: number,
easing: KeyboardEventEasing,
) => {
const finalHeight = isVisible ? height : 0;
const finalHeight = isVisible ? endCoordinatesHeight : 0;

const animationConfig = getKeyboardAnimationConfigs(easing, duration);

Expand Down
Loading