diff --git a/Sample/index.ios.js b/Sample/index.ios.js index e1d09b4..4ec7cb2 100644 --- a/Sample/index.ios.js +++ b/Sample/index.ios.js @@ -102,7 +102,7 @@ class SampleKeyboardManager extends Component { self.setState(state) }} placeholder={ref} - blurOnSubmit={true /* 'false' causes a react-native bug */} + blurOnSubmit={!multiline /* 'false' causes a react-native bug */} onSubmitEditing={nextFocus} multiline={multiline} numberOfLines={multiline ? 10 : 1} @@ -121,7 +121,7 @@ class SampleKeyboardManager extends Component { {/* To try with Modal, uncomment the two following lines. */} {/* */} - + {/* */} {/* ScrollView is not required, but may be needed in some cases. */} @@ -139,7 +139,7 @@ class SampleKeyboardManager extends Component { - + {/* */} {/* */} diff --git a/Sample/yarn.lock b/Sample/yarn.lock index 897a7e9..823e657 100644 --- a/Sample/yarn.lock +++ b/Sample/yarn.lock @@ -3429,7 +3429,7 @@ react-devtools-core@^2.5.0: ws "^2.0.3" "react-native-keyboard-manager@file:..": - version "4.0.13-1" + version "4.0.13-3" react-native@0.48.4: version "0.48.4" diff --git a/index.js b/index.js index 7a930d9..694b9d4 100644 --- a/index.js +++ b/index.js @@ -23,10 +23,11 @@ */ import { - NativeModules, DeviceEventEmitter, requireNativeComponent, + NativeModules, DeviceEventEmitter, requireNativeComponent, View, Platform, } from 'react-native'; +const { OS } = Platform; + +export const PreviousNextView = OS === 'ios' ? requireNativeComponent('RNKMPreviousNextView') : View; const KeyboardManager = NativeModules.ReactNativeKeyboardManager; export default KeyboardManager; - -export const PreviousNextView = requireNativeComponent('RNKMPreviousNextView'); diff --git a/package.json b/package.json index b691458..e495325 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-keyboard-manager", - "version": "4.0.13-2", + "version": "4.0.13-3", "description": "Library that allows to prevent issues of keyboard sliding up and cover on React-Native iOS projects. ⚛", "private": false, "repository": {