File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @react-native-ama/extras ' : patch
3
+ ---
4
+
5
+ Updated useKeyboard hook argument shouldHandleKeyboardEvents to default to true and not be required.
Original file line number Diff line number Diff line change @@ -21,19 +21,19 @@ const KEYBOARD_EVENT_HIDE: KeyboardEventName = Platform.select({
21
21
default : 'keyboardDidHide' ,
22
22
} ) ;
23
23
24
- export const useKeyboard = ( shouldHandleKeyboardEvents : boolean ) => {
24
+ export const useKeyboard = ( shouldHandleKeyboardEvents : boolean = true ) => {
25
25
const keyboardHeight = useSharedValue ( 0 ) ;
26
26
const keyboardFinalHeight = useSharedValue ( 0 ) ;
27
27
const isKeyboardVisible = useSharedValue ( false ) ;
28
28
29
29
const handleKeyboardEvent = useCallback (
30
30
(
31
31
isVisible : boolean ,
32
- height : number ,
32
+ endCoordinatesHeight : number ,
33
33
duration : number ,
34
34
easing : KeyboardEventEasing ,
35
35
) => {
36
- const finalHeight = isVisible ? height : 0 ;
36
+ const finalHeight = isVisible ? endCoordinatesHeight : 0 ;
37
37
38
38
const animationConfig = getKeyboardAnimationConfigs ( easing , duration ) ;
39
39
You can’t perform that action at this time.
0 commit comments