File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -93,10 +93,16 @@ export default class KeyboardAwareBase extends React.Component {
93
93
this . state . scrollBottomOnNextSizeChange = true ;
94
94
}
95
95
96
- scrollToBottom ( ) {
96
+ scrollToBottom ( scrollAnimated = true ) {
97
97
if ( this . _keyboardAwareView ) {
98
+
99
+ if ( ! this . _keyboardAwareView . contentSize ) {
100
+ setTimeout ( ( ) => this . scrollToBottom ( scrollAnimated ) , 50 ) ;
101
+ return ;
102
+ }
103
+
98
104
const bottomYOffset = this . _keyboardAwareView . contentSize . height - this . _keyboardAwareView . layout . height + this . _keyboardAwareView . props . contentInset . bottom ;
99
- this . _keyboardAwareView . scrollTo ( { x : 0 , y : bottomYOffset , animated : true } ) ;
105
+ this . _keyboardAwareView . scrollTo ( { x : 0 , y : bottomYOffset , animated : scrollAnimated } ) ;
100
106
}
101
107
}
102
108
}
You can’t perform that action at this time.
0 commit comments