Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix patch

Ammar Ahmedc423a3b4f2ec
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
index 0126b8188..b6e647df7 100644
--- a/apps/mobile/patches/react-native-actions-sheet+0.4.9.patch
+++ b/apps/mobile/patches/react-native-actions-sheet+0.4.9.patch
@@ -1,5 +1,5 @@
diff --git a/node_modules/react-native-actions-sheet/src/index.js b/node_modules/react-native-actions-sheet/src/index.js
-index dfa8fad..f5144e9 100644
+index dfa8fad..25f4d3f 100644
--- a/node_modules/react-native-actions-sheet/src/index.js
+++ b/node_modules/react-native-actions-sheet/src/index.js
@@ -72,7 +72,7 @@ export default class ActionSheet extends Component {
@@ -11,7 +11,7 @@ index dfa8fad..f5144e9 100644
let scrollOffset = this.props.gestureEnabled
? offset + correction + this.props.extraScroll
: offset + correction + this.props.extraScroll;
-@@ -188,17 +188,15 @@ export default class ActionSheet extends Component {
+@@ -188,23 +188,23 @@ export default class ActionSheet extends Component {
resolve(height === 0 ? 20 : height);
}
);
@@ -32,21 +32,30 @@ index dfa8fad..f5144e9 100644
if (this.layoutHasCalled) {
this._returnToPrevScrollPosition(height);
this.actionSheetHeight = height;
-@@ -227,12 +225,12 @@ export default class ActionSheet extends Component {
+ return;
+ } else {
+- this.actionSheetHeight = height;
++
++ this.layoutHasCalled = true;
++ this.actionSheetHeight = height
+ let scrollOffset = this.getInitialScrollPosition();
+ this.isRecoiling = false;
+ if (Platform.OS === "ios") {
+@@ -227,12 +227,11 @@ export default class ActionSheet extends Component {
this.underlayScale.setValue(1);
this.underlayTranslateY.setValue(100);
if (!gestureEnabled) {
- //DeviceEventEmitter.emit("hasReachedTop");
this.props.onPositionChanged && this.props.onPositionChanged(true);
}
- this.layoutHasCalled = true;
+- this.layoutHasCalled = true;
this.updateActionSheetPosition(scrollOffset);
}
+
};
_openAnimation = (scrollOffset) => {
-@@ -241,7 +239,7 @@ export default class ActionSheet extends Component {
+@@ -241,7 +240,7 @@ export default class ActionSheet extends Component {
if (animated) {
this.transformValue.setValue(scrollOffset);
Animated.parallel([
@@ -55,7 +64,7 @@ index dfa8fad..f5144e9 100644
toValue: 0,
bounciness: bounceOnOpen ? bounciness : 1,
speed: openAnimationSpeed,
-@@ -277,7 +275,7 @@ export default class ActionSheet extends Component {
+@@ -277,7 +276,7 @@ export default class ActionSheet extends Component {
let { springOffset, extraScroll } = this.props;
let verticalOffset = event.nativeEvent.contentOffset.y;
@@ -64,18 +73,18 @@ index dfa8fad..f5144e9 100644
if (this.isRecoiling) return;
if (this.prevScroll < verticalOffset) {
-@@ -321,8 +319,8 @@ export default class ActionSheet extends Component {
+@@ -321,8 +320,8 @@ export default class ActionSheet extends Component {
};
updateActionSheetPosition(scrollPosition) {
- if (!this.props.drawUnderStatusBar) return;
- if (scrollPosition > this.state.deviceHeight) {
-+ if (scrollPosition >= this.state.deviceHeight - 15) {
++ if (scrollPosition >= this.state.deviceHeight - 1) {
+ if (!this.props.drawUnderStatusBar) return;
this.indicatorTranslateY.setValue(0);
} else {
this.indicatorTranslateY.setValue(-this.state.paddingTop);
-@@ -330,7 +328,7 @@ export default class ActionSheet extends Component {
+@@ -330,11 +329,12 @@ export default class ActionSheet extends Component {
}
_returnToPrevScrollPosition(height) {
@@ -84,7 +93,12 @@ index dfa8fad..f5144e9 100644
let scrollOffset =
height * this.currentOffsetFromBottom +
correction +
-@@ -380,9 +378,10 @@ export default class ActionSheet extends Component {
+ this.props.extraScroll;
++
+ this.updateActionSheetPosition(scrollOffset);
+ this._scrollTo(scrollOffset);
+ }
+@@ -380,9 +380,10 @@ export default class ActionSheet extends Component {
this.targetId = event.nativeEvent.target;
this.offsetY = event.nativeEvent.contentOffset.y;
@@ -96,7 +110,7 @@ index dfa8fad..f5144e9 100644
if (distanceFromTop < 3) {
if (this.isReachedTop) {
this.isReachedTop = true;
-@@ -394,18 +393,10 @@ export default class ActionSheet extends Component {
+@@ -394,18 +395,10 @@ export default class ActionSheet extends Component {
this.props.onPositionChanged && this.props.onPositionChanged(false);
}
}
@@ -118,7 +132,7 @@ index dfa8fad..f5144e9 100644
this.indicatorTranslateY.setValue(
-this.state.paddingTop + (this.state.paddingTop - distanceFromTop)
);
-@@ -536,15 +527,22 @@ export default class ActionSheet extends Component {
+@@ -536,15 +529,22 @@ export default class ActionSheet extends Component {
this._onKeyboardHide
);
}
@@ -145,7 +159,7 @@ index dfa8fad..f5144e9 100644
}
let height = event.nativeEvent.layout.height - safeMarginFromTop;
-@@ -562,16 +560,16 @@ export default class ActionSheet extends Component {
+@@ -562,16 +562,16 @@ export default class ActionSheet extends Component {
deviceHeight: height,
deviceWidth: width,
portrait: height > width,
@@ -167,7 +181,7 @@ index dfa8fad..f5144e9 100644
let scrollPosition = this.props.gestureEnabled
? this.actionSheetHeight * this.props.initialOffsetFromBottom +
correction +
-@@ -626,7 +624,7 @@ export default class ActionSheet extends Component {
+@@ -626,7 +626,7 @@ export default class ActionSheet extends Component {
<SafeAreaView ref={this.safeAreaViewRef} style={styles.safearea}>
<View />
</SafeAreaView>
@@ -176,7 +190,7 @@ index dfa8fad..f5144e9 100644
<FlatList
bounces={false}
keyboardShouldPersistTaps={keyboardShouldPersistTaps}
-@@ -676,7 +674,7 @@ export default class ActionSheet extends Component {
+@@ -676,7 +676,7 @@ export default class ActionSheet extends Component {
onTouchStart={this._onTouchStart}
onTouchEnd={this._onTouchEnd}
style={{
@@ -185,7 +199,7 @@ index dfa8fad..f5144e9 100644
width: "100%",
zIndex: 10,
}}
-@@ -685,7 +683,7 @@ export default class ActionSheet extends Component {
+@@ -685,13 +685,15 @@ export default class ActionSheet extends Component {
onPress={this._onTouchBackdrop}
onLongPress={this._onTouchBackdrop}
style={{
@@ -194,9 +208,19 @@ index dfa8fad..f5144e9 100644
width: "100%",
}}
/>
-@@ -714,7 +712,7 @@ export default class ActionSheet extends Component {
+ </View>
+
+ <Animated.View
++
++onLayout={this._showModal}
+ style={[
+ styles.container,
+ {
+@@ -712,9 +714,8 @@ export default class ActionSheet extends Component {
+ ]}
+ >
<Animated.View
- onLayout={this._showModal}
+- onLayout={this._showModal}
style={{
- maxHeight: "100%",
+ maxHeight: this.state.deviceHeight,