fix: Keyboard issue fix #857
Conversation
place file at proper locatio
add test for new component keyboardawarecontainer
|
@Arjun-sna Nice HOC. Played in simulator and looked good, except sometimes when entered new issue screen without the keyboard, the screen will scroll up. |
| if (Platform.OS === 'android') { | ||
| this.props.onKeyboardStateChange('hide', e); | ||
| } | ||
| }); |
chinesedfan
Dec 28, 2018
Member
How about adding listeners by platform? Seems clearer and only 2 listeners at the same time, instead of 4.
if (Platform.OS === 'ios') {
this.keyboardShowListener = Keyboard.addListener(xx, e=> ...);
this.keyboardHideListener = Keyboard.addListener(xx, e=> ...);
} else if (Platform.OS === 'android') { ... }
chinesedfan
Jan 8, 2019
Member
Curious about different event names for different platforms. Can you explain a bit more?
bug fix and PR comments addressed
|
@chinesedfan added a commit addressing all the change requests. |
|
@Arjun-sna Apologize for my late feedbacks. |
| } | ||
| } | ||
|
|
||
| KeyboardAwareContainer.defaultProps = { |
| constructor(props) { | ||
| super(props); | ||
| this.keyboardWillShowSub = null; | ||
| this.keyboardWillHideSub = null; |
chinesedfan
Jan 8, 2019
Member
Do the right flow type annotations like following? Sorry that I'm a flow expert and I don't know how to import EmitterSubscription.
keyboardWillShowSub: EmitterSubscription;
keyboardWillHideSub: EmitterSubscription;
By the way, to make eslint happy, we need update our .eslintrc.
"react/sort-comp": [
"error",
{
"order": [
"static-methods",
+ "type-annotations",
| } = this.state; | ||
|
|
||
| return ( | ||
| <ViewContainer> | ||
| <KeyboardAwareContainer | ||
| style={{ flex: 1 }} |
chinesedfan
Jan 8, 2019
Member
As new-issue screen has been written with styled components, you'd better convert it, too.
| } | ||
|
|
||
| render() { | ||
| return <View style={this.props.style}>{this.props.children}</View>; |
|
What's more, #447 (comment) mentioned that RN 0.55 would introduce an official way to solve it. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.


Screenshots
Description