Skip to content

Commit

Permalink
fix: update props of TextInput
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillzyusko committed Jan 14, 2025
1 parent ce6224b commit cee3449
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ function InteractiveKeyboard() {
const ref = useRef<Reanimated.ScrollView>(null);
const { height, onScroll, inset, offset } = useKeyboardAnimation();
const [inputHeight, setInputHeight] = useState(TEXT_INPUT_HEIGHT);
const [text, setText] = useState("");

const onInputLayoutChanged = useCallback((e: LayoutChangeEvent) => {
setInputHeight(e.nativeEvent.layout.height);
Expand Down Expand Up @@ -149,6 +150,8 @@ function InteractiveKeyboard() {
nativeID="chat-input"
style={textInputStyle}
testID="chat.input"
value={text}
onChangeText={setText}
onLayout={onInputLayoutChanged}
/>
</KeyboardGestureArea>
Expand Down
3 changes: 3 additions & 0 deletions example/src/screens/Examples/InteractiveKeyboardIOS/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ function InteractiveKeyboard() {
const ref = useRef<Reanimated.ScrollView>(null);
const { height, onScroll, inset, offset } = useKeyboardAnimation();
const [inputHeight, setInputHeight] = useState(TEXT_INPUT_HEIGHT);
const [text, setText] = useState("");

const onInputLayoutChanged = useCallback((e: LayoutChangeEvent) => {
setInputHeight(e.nativeEvent.layout.height);
Expand Down Expand Up @@ -149,6 +150,8 @@ function InteractiveKeyboard() {
nativeID="chat-input"
style={textInputStyle}
testID="chat.input"
value={text}
onChangeText={setText}
onLayout={onInputLayoutChanged}
/>
</KeyboardGestureArea>
Expand Down

0 comments on commit cee3449

Please sign in to comment.