Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu list items are pressable after close #76

Open
SohelIslamImran opened this issue Jul 20, 2022 · 14 comments · May be fixed by #115
Open

Menu list items are pressable after close #76

SohelIslamImran opened this issue Jul 20, 2022 · 14 comments · May be fixed by #115
Labels
bug Something isn't working

Comments

@SohelIslamImran
Copy link

SohelIslamImran commented Jul 20, 2022

Describe the bug
When you first time open manu, the area of where the menu list items were opened, are pressable. Menu is hidden, But still can press the menu items. Can't understand what is the problem .. Please fix.

Package versions
"react": "17.0.2",
"react-native": "0.68.2",
"react-native-reanimated": "~2.8.0",
"react-native-hold-menu": "^0.1.5",
"expo": "^45.0.6",

@SohelIslamImran SohelIslamImran added the bug Something isn't working label Jul 20, 2022
@SohelIslamImran
Copy link
Author

@enesozturk

@SohelIslamImran
Copy link
Author

I think you need to minus (-) zindex of menu, when close/inactive

@SohelIslamImran
Copy link
Author

Another problem found @enesozturk , items props on HoldItem component are not changing, it kept memorized. So it is causing problems with multiple HoldItem on multiple screens. When I open a hold menu and then go to another screen and open another hold menu, it keeps the previous items, not showing this new menu items.

@SohelIslamImran
Copy link
Author

SohelIslamImran commented Jul 21, 2022

Unfortunately, this package is not working as expected and as shown in the documentation, examples and gif. So sad☹️.

@enesozturk
Copy link
Owner

enesozturk commented Jul 23, 2022

This is indeed unexpected and I cannot reproduce the same issue you recorded. Do you get the same with all the use cases? Which version are you using?

items props on HoldItem component are not changing

This was one of the old issues and I remember it's solved. When I run the example on the same device (It's Expo, so would be easy to test), I cannot see the same issue between the examples.

@SohelIslamImran
Copy link
Author

SohelIslamImran commented Jul 23, 2022

Alright. But let's quick fix the first and main issue. (The Menu list items pressable issue on android) @enesozturk

@SohelIslamImran
Copy link
Author

SohelIslamImran commented Jul 23, 2022

This is indeed unexpected and I cannot reproduce the same issue you recorded. Do you get the same with all the use cases? Which version are you using?

items props on HoldItem component are not changing

This was one of the old issues and I remember it's solved. When I run the example on the same device (It's Expo, so would be easy to test), I cannot see the same issue between the examples.

Actually, I found the exact issue. The deepEqual in react-native-hold-menu\src\components\menu\MenuList.tsx are returning true, even they are not equal. Please check and fix the deepEqual. @enesozturk
image

Mainly, this condition is not working on React native. It always returns true even if functions are not equal.

image

@SohelIslamImran
Copy link
Author

Please try to fix these two issues ASAP @enesozturk 🙏🙏!!

@SohelIslamImran
Copy link
Author

SohelIslamImran commented Jul 23, 2022

In browser or node, function.toString() convert the function body to string. Like this

image

But in React Native, it always converts to this. So the equal (===) condition always returns true.

image

Is it clear? @enesozturk

@SohelIslamImran
Copy link
Author

SohelIslamImran commented Jul 23, 2022

I found this issue facebook/hermes#114 and facebook/hermes#612 (comment)

@SohelIslamImran
Copy link
Author

Bump. Waiting

@SohelIslamImran
Copy link
Author

In browser or node, function.toString() convert the function body to string. Like this

image

But in React Native, it always converts to this. So the equal (===) condition always returns true.

image

Is it clear? @enesozturk

I console logged normal function. It is showing the function body. The reason of the above issue is you used useSharedValue for store items. I think you need to use react state or context. @enesozturk

image

@SohelIslamImran
Copy link
Author

SohelIslamImran commented Jul 27, 2022

@enesozturk Can you please fix these issues ASAP? My app is buggy for this package now. Or instead, I should find another package?

@kesha-antonov
Copy link
Contributor

kesha-antonov commented Jan 8, 2024

Hi
I encountered this issue also on Android 11
Area where menu was remains tappable

I use latest version of the lib

UPD. Created PR for this

#115

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants