diff --git a/node_modules/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js b/node_modules/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js index 4536402..2a100d9 100644 --- a/node_modules/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js +++ b/node_modules/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js @@ -64,7 +64,7 @@ class KeyboardAvoidingView extends React.Component { _subscriptions: Array = []; viewRef: {current: React.ElementRef | null, ...}; _initialFrameHeight: number = 0; - + keyboardShown = false; constructor(props: Props) { super(props); this.state = {bottom: 0}; @@ -80,7 +80,9 @@ class KeyboardAvoidingView extends React.Component { const keyboardY = keyboardFrame.screenY - (this.props.keyboardVerticalOffset ?? 0); - // Calculate the displacement needed for the view such that it + + if (this._initialFrameHeight && frame.height < this._initialFrameHeight && this.keyboardShown) frame.height = this._initialFrameHeight; + // Calculate the displacement needed for the view such that it // no longer overlaps with the keyboard return Math.max(frame.y + frame.height - keyboardY, 0); } @@ -92,7 +94,9 @@ class KeyboardAvoidingView extends React.Component { _onLayout = (event: ViewLayoutEvent) => { const wasFrameNull = this._frame == null; + this._frame = event.nativeEvent.layout; + if (!this._initialFrameHeight) { // save the initial frame height, before the keyboard is visible this._initialFrameHeight = this._frame.height; @@ -142,6 +146,8 @@ class KeyboardAvoidingView extends React.Component { this._subscriptions = [ Keyboard.addListener('keyboardDidHide', this._onKeyboardChange), Keyboard.addListener('keyboardDidShow', this._onKeyboardChange), + Keyboard.addListener('keyboardDidHide', () => this.keyboardShown = true), + Keyboard.addListener('keyboardDidShow', () => this.keyboardShown = false), ]; } } diff --git a/node_modules/react-native/React/.DS_Store b/node_modules/react-native/React/.DS_Store new file mode 100644 index 0000000..5155fbe Binary files /dev/null and b/node_modules/react-native/React/.DS_Store differ diff --git a/node_modules/react-native/React/Views/ScrollView/RCTScrollView.m b/node_modules/react-native/React/Views/ScrollView/RCTScrollView.m index f0f6402..d645d81 100644 --- a/node_modules/react-native/React/Views/ScrollView/RCTScrollView.m +++ b/node_modules/react-native/React/Views/ScrollView/RCTScrollView.m @@ -685,7 +685,18 @@ - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView : MAX(0, _scrollView.contentSize.height - viewportSize.height); // Calculate the snap offsets adjacent to the initial offset target - CGFloat targetOffset = isHorizontal ? targetContentOffset->x : targetContentOffset->y; + //CGFloat targetOffset = isHorizontal ? targetContentOffset->x : targetContentOffset->y; + /** + * https://github.com/facebook/react-native/pull/30033/files/af9c24639073e57f4e309851893e96da2e54271d..52a3d8d87778614b84a113f9198b88fc152a5a26 + */ + CGFloat targetOffset = targetContentOffset->y; + if (isHorizontal) { + // Use current scroll offset to determine the next index to snap to when momentum disabled + targetOffset = self.disableIntervalMomentum ? scrollView.contentOffset.x : targetContentOffset->x; + } else { + targetOffset = self.disableIntervalMomentum ? scrollView.contentOffset.y : targetContentOffset->y; + } + CGFloat smallerOffset = 0.0; CGFloat largerOffset = maximumOffset; diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env new file mode 100644 index 0000000..361f5fb --- /dev/null +++ b/node_modules/react-native/scripts/.packager.env @@ -0,0 +1 @@ +export RCT_METRO_PORT=8081 diff --git a/node_modules/react-native/scripts/packager.sh b/node_modules/react-native/scripts/packager.sh index b9f9016..8859130 100755 --- a/node_modules/react-native/scripts/packager.sh +++ b/node_modules/react-native/scripts/packager.sh @@ -8,17 +8,17 @@ THIS_DIR=$(cd -P "$(dirname "$(realpath "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd) REACT_NATIVE_ROOT="$THIS_DIR/.." # Application root directory - General use case: react-native is a dependency -PROJECT_ROOT="$THIS_DIR/../../.." +PROJECT_ROOT="$THIS_DIR/../../../native" # check and assign NODE_BINARY env # shellcheck disable=SC1090 source "${THIS_DIR}/node-binary.sh" # When running react-native tests, react-native doesn't live in node_modules but in the PROJECT_ROOT -if [ ! -d "$PROJECT_ROOT/node_modules/react-native" ]; -then - PROJECT_ROOT="$THIS_DIR/.." -fi +# if [ ! -d "$PROJECT_ROOT/node_modules/react-native" ]; +# then +# PROJECT_ROOT="$THIS_DIR/.." +# fi # Start packager from PROJECT_ROOT cd "$PROJECT_ROOT" || exit "$NODE_BINARY" "$REACT_NATIVE_ROOT/cli.js" start --custom-log-reporter-path "$THIS_DIR/packager-reporter.js" "$@" diff --git a/node_modules/react-native/scripts/react-native-xcode.sh b/node_modules/react-native/scripts/react-native-xcode.sh index 6f95a29..900313c 100755 --- a/node_modules/react-native/scripts/react-native-xcode.sh +++ b/node_modules/react-native/scripts/react-native-xcode.sh @@ -60,7 +60,7 @@ esac REACT_NATIVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # The project should be located next to where react-native is installed # in node_modules. -PROJECT_ROOT=${PROJECT_ROOT:-"$REACT_NATIVE_DIR/../.."} +PROJECT_ROOT=${PROJECT_ROOT:-"$REACT_NATIVE_DIR/../../native"} cd "$PROJECT_ROOT" || exit diff --git a/node_modules/react-native/scripts/react_native_pods.rb b/node_modules/react-native/scripts/react_native_pods.rb index e7c59ad..1461d45 100644 --- a/node_modules/react-native/scripts/react_native_pods.rb +++ b/node_modules/react-native/scripts/react_native_pods.rb @@ -420,7 +420,7 @@ def get_react_codegen_spec(options={}) 'source' => { :git => '' }, 'header_mappings_dir' => './', 'platforms' => { - 'ios' => '11.0', + 'ios' => '12.0', }, 'source_files' => "**/*.{h,mm,cpp}", 'pod_target_xcconfig' => { "HEADER_SEARCH_PATHS" =>