diff --git a/app/components/note-input/note-input.tsx b/app/components/note-input/note-input.tsx index 5d59936b6f..e082139e54 100644 --- a/app/components/note-input/note-input.tsx +++ b/app/components/note-input/note-input.tsx @@ -1,5 +1,5 @@ -import React from "react" -import { View, TextInput, StyleProp, ViewStyle } from "react-native" +import React, { useRef } from "react" +import { View, TextInput, StyleProp, ViewStyle, TouchableOpacity } from "react-native" import { useI18nContext } from "@app/i18n/i18n-react" import { testProps } from "@app/utils/testProps" @@ -29,7 +29,13 @@ export const NoteInput: React.FC = ({ const { theme: { colors }, } = useTheme() + const textInputRef = useRef(null) + const focusTextInput = () => { + if (textInputRef.current) { + textInputRef.current.focus() + } + } return ( @@ -44,10 +50,11 @@ export const NoteInput: React.FC = ({ editable={editable} selectTextOnFocus maxLength={500} + ref={textInputRef} /> - + - + )