Comments (10)
I did some debug with coloring views and I found out that the menu item height is incorrect. It has green color on the screenshot
So I added height explicitly to the menuItem styles and it solves my issue.
--- a/node_modules/react-native-hold-menu/src/components/menu/MenuItem.tsx
+++ b/node_modules/react-native-hold-menu/src/components/menu/MenuItem.tsx
@@ -13,6 +13,7 @@ import { BORDER_LIGHT_COLOR, BORDER_DARK_COLOR } from './constants';
import isEqual from 'lodash.isequal';
import { getColor } from './calculations';
import { AnimatedIcon } from '../provider/Provider';
+import {MenuItemHeight} from '../../utils/calculations';
const ItemComponent = IS_IOS ? TouchableOpacity : GHTouchableOpacity;
// @ts-ignore
@@ -33,6 +34,7 @@ const MenuItemComponent = ({ item, isLast }: MenuItemComponentProps) => {
return {
borderBottomColor,
borderBottomWidth: isLast ? 0 : 1,
+ height: MenuItemHeight(),
};
}, [theme, isLast, item]);
from react-native-hold-menu.
@dimaportenko with fix I shared above, I don't see any issues on my side so far.
from react-native-hold-menu.
hi @dimaportenko , did u ever try with adding customview like this?
from react-native-hold-menu.
Thanks for the tip, it happens to us sometimes too.
Sometimes it's wrong menu item height, sometimes menu shows not alongside the item tapped but with some offset so it's partially visible. Sometimes the UI elements below the holdable item are not pressable (some portal/overlays don't get unmounted?)
I did some coloring too, but didn't spent much time and had no success debugging this.
Have you encountered same issues by chance?
from react-native-hold-menu.
@enesozturk if you fine to add menu height. I can prepare PR.
from react-native-hold-menu.
Hi @dimaportenko, sorry I couldn't spend time on this for a while that is why couldn't try. Glad to hear you solved it, highly appreciate it if you can open a PR. Thanks!
from react-native-hold-menu.
@enesozturk np, same for me I haven't time to prepare pr yet. But it is still somewhere on my list.
from react-native-hold-menu.
@fukemy nope, I haven't tried anything like this. Tbh I've just started to use the library with the simple case you can see in my first post on this issue. But I think I'll try more later on.
from react-native-hold-menu.
tks, even in native i didnt see any app can apply it's inside their app, but Message and Telegram did it with very nice ui, i will waiting for your update
from react-native-hold-menu.
hi bro @enesozturk , i just found stream chat done it, they using TypeScript + Reanimated2 only and didnt use context menu api from Apple
from react-native-hold-menu.
Related Issues (20)
- With `Expo-router`, `HoldItem` clicked moves the height of the header HOT 2
- `undefined is not a function` HOT 1
- If menu items do not have unique names keys are not updating HOT 3
- Exposes a `key` value for `MenuItemProps` menu items that are identical other than their `onPress` function are approriately re-rendered HOT 2
- Expo 49 - Breaking Changes HOT 18
- item.onPress.apply is not a function HOT 1
- HoldItem causing entire component to re-render HOT 7
- Bottom item is too short HOT 1
- Menu displays behind modal screen HOT 1
- Expo Managed app support HOT 1
- `HoldItem` react context is incorrect HOT 2
- Position of element doesn't take header and other content into account HOT 1
- Doesn't expire cached items prop with arrow functions HOT 6
- v0.1.5 has many differences with main branch HOT 4
- It doesn't work combined with react-navigation on expo managed projects :(
- HoldMenuProvider crashes expo on reload HOT 3
- Padding Bug HOT 3
- Clashing dependencies
- Is project still maintained ? HOT 5
- v0.1.6 is not available on npmjs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-hold-menu.