mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-01 21:12:19 +08:00
Summary:
relativeKeyboardHeight calculation is wrong when frame.y < keyboardFrame.y
Let's look at an example:
``` jsx
import React, { Component } from 'react';
import {
KeyboardAvoidingView,
TextInput,
AppRegistry,
Text,
View
} from 'react-native';
export default class Test extends Component {
constructor(props, context) {
super(props, context);
}
render() {
return (
<View style={{flex: 1, marginTop: 20}}>
<Text style={{ flex: 1, alignItems: 'center'}}>
Hi! This is test.
</Text>
<KeyboardAvoidingView behavior={'position'} keyboardVerticalOffset={-20} >
<TextInput
style={{height: 40, borderColor: 'gray', borderWidth: 1}}
/>
</KeyboardAvoidingView>
</View>
);
}
}
AppRegistry.registerComponent('Test', () => Test);
```

How _relativeKeyboardHeight_ calculates positio
Closes https://github.com/facebook/react-native/pull/9139
Differential Revision: D4168431
Pulled By: hramos
fbshipit-source-id: 9181276355490452071b51b51ed7dc9ab80b2444