Skip to content

Commit e8d528f

Browse files
LudvigGislasonalvaromb
authored andcommitted
When enableResetScrollToCoords is not false, use this.props.resetScro… (#309)
* When enableResetScrollToCoords is not false, use this.props.resetScrollToCoords if defined. * Drop definition of unused property.
1 parent cb326df commit e8d528f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/KeyboardAwareHOC.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ function KeyboardAwareHOC(
152152
keyboardWillHideEvent: ?Function
153153
position: ContentOffset
154154
defaultResetScrollToCoords: ?{ x: number, y: number }
155-
resetCoords: ?{ x: number, y: number }
156155
mountedComponent: boolean
157156
handleOnScroll: Function
158157
state: KeyboardAwareHOCState
@@ -420,7 +419,7 @@ function KeyboardAwareHOC(
420419
}
421420
)
422421
}
423-
if (!this.resetCoords) {
422+
if (!this.props.resetScrollToCoords) {
424423
if (!this.defaultResetScrollToCoords) {
425424
this.defaultResetScrollToCoords = this.position
426425
}
@@ -436,8 +435,8 @@ function KeyboardAwareHOC(
436435
if (this.props.enableResetScrollToCoords === false) {
437436
this.defaultResetScrollToCoords = null
438437
return
439-
} else if (this.resetCoords) {
440-
this.scrollToPosition(this.resetCoords.x, this.resetCoords.y, true)
438+
} else if (this.props.resetScrollToCoords) {
439+
this.scrollToPosition(this.props.resetScrollToCoords.x, this.props.resetScrollToCoords.y, true)
441440
} else {
442441
if (this.defaultResetScrollToCoords) {
443442
this.scrollToPosition(

0 commit comments

Comments
 (0)