-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix keyboard aware scroll view related problem (#291)
* fix: scrollview drag problem * fix: persistant scroll on each click * fix: align seed input to top on Android * fix: code prettier * fix: according to the PR suggestion
- Loading branch information
1 parent
e5a9e29
commit fe2841a
Showing
5 changed files
with
186 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import { Keyboard, Platform } from 'react-native'; | ||
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; | ||
|
||
class KeyboardScrollView extends React.Component { | ||
render() { | ||
const defaultProps = { enableAutomaticScroll: true }; | ||
return Platform.select({ | ||
ios: ( | ||
<KeyboardAwareScrollView | ||
keyboardDismissMode="interactive" | ||
keyboardShouldPersistTaps="handled" | ||
{...defaultProps} | ||
{...this.props} | ||
/> | ||
), | ||
android: ( | ||
<KeyboardAwareScrollView | ||
keyboardDismissMode="on-drag" | ||
onScrollEndDrag={Keyboard.dismiss} | ||
keyboardShouldPersistTaps="handled" | ||
enableOnAndroid | ||
{...defaultProps} | ||
{...this.props} | ||
/> | ||
) | ||
}); | ||
} | ||
} | ||
|
||
export default KeyboardScrollView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.