Skip to content

Commit

Permalink
Merge pull request #29339 from bernhardoj/fix/26958-fix-bank-account-…
Browse files Browse the repository at this point in the history
…crash

Fix app crash when visiting bank account page
  • Loading branch information
NikkiWines authored Oct 13, 2023
2 parents 31c417b + 00e2539 commit 362d2ad
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/components/TextInput/BaseTextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,11 @@ function BaseTextInput(props) {
return;
}

let focusTimeout;
if (props.shouldDelayFocus) {
focusTimeout = setTimeout(() => input.current.focus(), CONST.ANIMATED_TRANSITION);
return;
const focusTimeout = setTimeout(() => input.current.focus(), CONST.ANIMATED_TRANSITION);
return () => clearTimeout(focusTimeout);
}
input.current.focus();

return () => {
if (!focusTimeout) {
return;
}
clearTimeout(focusTimeout);
};
// We only want this to run on mount
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
Expand Down

0 comments on commit 362d2ad

Please sign in to comment.