From eded45cb22f536587cee898ad42c8076b70d2e38 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Mon, 12 Jul 2021 10:54:57 +0500 Subject: [PATCH] add actionsheet patch --- .../react-native-actions-sheet+0.4.9.patch | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 apps/mobile/patches/react-native-actions-sheet+0.4.9.patch diff --git a/apps/mobile/patches/react-native-actions-sheet+0.4.9.patch b/apps/mobile/patches/react-native-actions-sheet+0.4.9.patch new file mode 100644 index 000000000..b63da262b --- /dev/null +++ b/apps/mobile/patches/react-native-actions-sheet+0.4.9.patch @@ -0,0 +1,35 @@ +diff --git a/node_modules/react-native-actions-sheet/src/index.js b/node_modules/react-native-actions-sheet/src/index.js +index 7b2becc..4962a5b 100644 +--- a/node_modules/react-native-actions-sheet/src/index.js ++++ b/node_modules/react-native-actions-sheet/src/index.js +@@ -388,7 +388,8 @@ export default class ActionSheet extends Component { + + let correction = this.state.deviceHeight * 0.15; + let distanceFromTop = this.actionSheetHeight + correction - this.offsetY; +- if (distanceFromTop < 3) { ++ ++ if (this.actionSheetHeight < this.offsetY) { + if (!this.isReachedTop) { + this.isReachedTop = true; + this.props.onPositionChanged && this.props.onPositionChanged(true); +@@ -438,7 +439,7 @@ export default class ActionSheet extends Component { + + _onKeyboardShow = (e) => { + this.setState({ +- keyboard: true ++ keyboard: true, + }); + const ReactNativeVersion = require("react-native/Libraries/Core/ReactNativeVersion"); + +@@ -466,8 +467,10 @@ export default class ActionSheet extends Component { + if (gap >= 0) { + return; + } ++ let toValue = this.props.keyboardMode === "position" ? -(keyboardHeight + 15) : gap - 10 ++ + Animated.timing(this.transformValue, { +- toValue: gap - 10, ++ toValue:toValue, + duration: 250, + useNativeDriver: true + }).start();