Skip to content

Commit

Permalink
mobile: fix material menu
Browse files Browse the repository at this point in the history
  • Loading branch information
ammarahm-ed committed Jan 20, 2025
1 parent 92f5e04 commit 4a4c52e
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions apps/mobile/patches/react-native-material-menu+2.0.0.patch
Original file line number Diff line number Diff line change
@@ -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);
Expand Down

0 comments on commit 4a4c52e

Please sign in to comment.