Skip to content

Commit

Permalink
fix: prevent error if no currently focused text input found
Browse files Browse the repository at this point in the history
  • Loading branch information
rlemasquerier committed Jan 4, 2024
1 parent 768e3e8 commit 228e550
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/KeyboardScrollView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const KeyboardScrollView = ({
const currentlyFocusedInput = TextInput.State.currentlyFocusedInput();
const currentScrollY = scrollPositionRef.current;

currentlyFocusedInput.measureInWindow((_x, y, _width, height) => {
currentlyFocusedInput?.measureInWindow((_x, y, _width, height) => {
const endOfInputY = y + height + androidStatusBarOffset;
const deltaToScroll = endOfInputY - keyboardY;

Expand Down

0 comments on commit 228e550

Please sign in to comment.