Skip to content

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

mobile: fix material menu

Ammar Ahmed4a4c52e4c82c
diff --git a/apps/mobile/patches/react-native-material-menu+2.0.0.patch b/apps/mobile/patches/react-native-material-menu+2.0.0.patch
index 2330ba5ba..c990b1a0e 100644
--- a/apps/mobile/patches/react-native-material-menu+2.0.0.patch
+++ b/apps/mobile/patches/react-native-material-menu+2.0.0.patch
@@ -1,12 +1,26 @@
diff --git a/node_modules/react-native-material-menu/dist/Menu.js b/node_modules/react-native-material-menu/dist/Menu.js
-index 64fbf13..c7fcee0 100644
+index 64fbf13..beeda72 100644
--- a/node_modules/react-native-material-menu/dist/Menu.js
+++ b/node_modules/react-native-material-menu/dist/Menu.js
-@@ -132,10 +132,13 @@ class Menu extends react_1.default.Component {
- else if (left < SCREEN_INDENT) {
- left = SCREEN_INDENT;
+@@ -55,7 +55,7 @@ class Menu extends react_1.default.Component {
+ };
+ // Start menu animation
+ onMenuLayout = (e) => {
+- if (this.state.menuState === States.Animating) {
++ if (this.state.menuState === States.Animating || this.state.menuState === States.Hidden) {
+ return;
+ }
+ const { width, height } = e.nativeEvent.layout;
+@@ -110,6 +110,7 @@ class Menu extends react_1.default.Component {
+ this.props.onRequestClose?.();
+ };
+ render() {
++
+ const { isRTL } = react_native_1.I18nManager;
+ const dimensions = react_native_1.Dimensions.get('window');
+ const { width: windowWidth } = dimensions;
+@@ -134,8 +135,10 @@ class Menu extends react_1.default.Component {
}
-+ console.log(top, windowHeight - menuHeight - SCREEN_INDENT);
// Flip by Y axis if menu hits bottom screen border
if (top > windowHeight - menuHeight - SCREEN_INDENT) {
+ const diff = top - (windowHeight - menuHeight - SCREEN_INDENT);