diff --git a/example/src/screens/Examples/InteractiveKeyboardIOS/index.tsx b/example/src/screens/Examples/InteractiveKeyboardIOS/index.tsx index 162dee104f..9295428f13 100644 --- a/example/src/screens/Examples/InteractiveKeyboardIOS/index.tsx +++ b/example/src/screens/Examples/InteractiveKeyboardIOS/index.tsx @@ -1,5 +1,5 @@ -import React, { useCallback, useRef } from 'react'; -import { TextInput, View } from 'react-native'; +import React, { useCallback, useRef, useState } from 'react'; +import { Button, InputAccessoryView, Modal, TextInput, View } from 'react-native'; import { useKeyboardHandler } from 'react-native-keyboard-controller'; import Reanimated, { useAnimatedStyle, @@ -12,6 +12,8 @@ import styles from './styles'; const AnimatedTextInput = Reanimated.createAnimatedComponent(TextInput); +const inputAccessoryViewID = 'uniqueID'; + const useKeyboardAnimation = () => { const progress = useSharedValue(0); const height = useSharedValue(0); @@ -35,6 +37,8 @@ const useKeyboardAnimation = () => { onInteractive: (e) => { 'worklet'; + console.log(e); + progress.value = e.progress; height.value = e.height; }, @@ -67,6 +71,7 @@ const contentContainerStyle = { function InteractiveKeyboard() { const ref = useRef(null); const { height } = useKeyboardAnimation(); + const [visible, setVisible] = useState(false); const scrollToBottom = useCallback(() => { ref.current?.scrollToEnd({ animated: false }); @@ -85,6 +90,22 @@ function InteractiveKeyboard() { return ( + setVisible(false)} + > + + +