@@ -76,7 +76,9 @@ const KeyboardAwareMixin = {
7676 )
7777 }
7878 if ( ! this . resetCoords ) {
79- this . defaultResetScrollToCoords = this . position
79+ if ( ! this . defaultResetScrollToCoords ) {
80+ this . defaultResetScrollToCoords = this . position
81+ }
8082 }
8183 } ,
8284
@@ -85,11 +87,17 @@ const KeyboardAwareMixin = {
8587 this . setState ( { keyboardSpace} )
8688 // Reset scroll position after keyboard dismissal
8789 if ( this . props . enableResetScrollToCoords === false ) {
90+ this . defaultResetScrollToCoords = null
8891 return
8992 } else if ( this . resetCoords ) {
9093 this . scrollToPosition ( this . resetCoords . x , this . resetCoords . y , true )
9194 } else {
92- this . scrollToPosition ( this . defaultResetScrollToCoords . x , this . defaultResetScrollToCoords . y , true )
95+ if ( this . defaultResetScrollToCoords ) {
96+ this . scrollToPosition ( this . defaultResetScrollToCoords . x , this . defaultResetScrollToCoords . y , true )
97+ this . defaultResetScrollToCoords = null
98+ } else {
99+ this . scrollToPosition ( 0 , 0 , true )
100+ }
93101 }
94102 } ,
95103
@@ -128,7 +136,7 @@ const KeyboardAwareMixin = {
128136
129137 position: { x : 0 , y : 0 } ,
130138
131- defaultResetScrollToCoords : { x : 0 , y : 0 } ,
139+ defaultResetScrollToCoords : null , // format: {x: 0, y: 0}
132140
133141 handleOnScroll : function ( e ) {
134142 this . position = e . nativeEvent . contentOffset
0 commit comments