From 4a4c52e4c82c39f16757ac885ea3f890348236d9 Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Wed, 15 Jan 2025 11:33:57 +0500 Subject: [PATCH] mobile: fix material menu --- .../react-native-material-menu+2.0.0.patch | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) 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);