Skip to content

Commit

Permalink
Merge pull request #147 from millicast/bugfix/direct-focus-on-input-f…
Browse files Browse the repository at this point in the history
…ields

Force focus on input fields
  • Loading branch information
aravind-raveendran authored Jun 6, 2024
2 parents 56cc63a + 6b853fc commit 02e6d48
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/screens/userInput/UserInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export const UserInput = ({ navigation }) => {
validation={validation}
autoFocus={!Platform.isTV}
testID="StreamNameInput"
onSubmitEditing={() => accountIdRef.current.focus()}
/>
</FocusedComponent>
<FocusedComponent testID="AccountIdFocusElement" componentRef={accountIdRef}>
Expand All @@ -151,6 +152,13 @@ export const UserInput = ({ navigation }) => {
onChangeText={onChangeAccountId}
validation={validation}
testID="AccountIdInput"
onSubmitEditing={() => {
if (Platform.isTV && Platform.OS === 'android') {
// FIXME: Workaround in Android TV's to keep the focus directed
// to another input field otherwise the focus is lost.
streamNameRef.current.focus()
}
}}
/>
</FocusedComponent>
<Button
Expand Down

0 comments on commit 02e6d48

Please sign in to comment.