Skip to content

Commit

Permalink
fixes scroll responder on rn 0.65.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hussein abdulnabi authored and hussein abdulnabi committed Jun 27, 2021
1 parent b04ea0e commit e66c4a6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/KeyboardAwareHOC.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,12 @@ function KeyboardAwareHOC(

scrollToPosition = (x: number, y: number, animated: boolean = true) => {
const responder = this.getScrollResponder()
responder && responder.scrollResponderScrollTo({ x, y, animated })
responder && responder.scrollTo({ x, y, animated })
}

scrollToEnd = (animated?: boolean = true) => {
const responder = this.getScrollResponder()
responder && responder.scrollResponderScrollToEnd({ animated })
responder && responder.scrollToEnd({ animated })
}

scrollForExtraHeightOnAndroid = (extraHeight: number) => {
Expand Down Expand Up @@ -371,7 +371,7 @@ function KeyboardAwareHOC(
keyboardSpace -= _KAM_DEFAULT_TAB_BAR_HEIGHT
}
this.setState({ keyboardSpace })
const currentlyFocusedField = TextInput.State.currentlyFocusedInput ? findNodeHandle(TextInput.State.currentlyFocusedInput()) : TextInput.State.currentlyFocusedField()
const currentlyFocusedField = TextInput.State.currentlyFocusedInput ? findNodeHandle(TextInput.State.currentlyFocusedInput()) : TextInput.State.currentlyFocusedField()
const responder = this.getScrollResponder()
if (!currentlyFocusedField || !responder) {
return
Expand Down Expand Up @@ -416,7 +416,7 @@ function KeyboardAwareHOC(
) {
this.scrollForExtraHeightOnAndroid(
totalExtraHeight -
(keyboardPosition - textInputBottomPosition)
(keyboardPosition - textInputBottomPosition)
)
}
}
Expand Down Expand Up @@ -494,7 +494,7 @@ function KeyboardAwareHOC(
}

update = () => {
const currentlyFocusedField = TextInput.State.currentlyFocusedInput ? findNodeHandle(TextInput.State.currentlyFocusedInput()) : TextInput.State.currentlyFocusedField()
const currentlyFocusedField = TextInput.State.currentlyFocusedInput ? findNodeHandle(TextInput.State.currentlyFocusedInput()) : TextInput.State.currentlyFocusedField()
const responder = this.getScrollResponder()

if (!currentlyFocusedField || !responder) {
Expand Down

0 comments on commit e66c4a6

Please sign in to comment.