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 is buggy / out of sync #316

Open
5 tasks done
dcallus opened this issue Sep 20, 2024 · 2 comments
Open
5 tasks done

Menu is buggy / out of sync #316

dcallus opened this issue Sep 20, 2024 · 2 comments
Labels

Comments

@dcallus
Copy link

dcallus commented Sep 20, 2024

Summary

When selecting text very fast (i.e. letting go of selection straight away) on iPhone, the menu doesn't pop up and you must tap the selection to get the menu up.

Also, when you have logic in the menu e.g.

menuItems={
someFunction() ?
[
{
label: "Dictionary",
key: "dictionary",
},
{
label: "Copy",
key: "copy",
}
]
:
[]
}

the menu can get out of sync. It may display when it's not supposed to and not display when it should. Almost like it's using a ref that's behind state, but not always, just on occasion.

What platform(s) does this occur on?

iOS

What workflow(s) does this occur on?

Expo Workflow

Environment (or package.json)

{
"name": "pagepal",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"lint": "eslint ."
},
"dependencies": {
"@dr.pogodin/react-native-static-server": "^0.12.0",
"@epubjs-react-native/core": "^1.4.1",
"@epubjs-react-native/expo-file-system": "^1.1.3",
"@gorhom/bottom-sheet": "^4.6.1",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-navigation/bottom-tabs": "^6.6.1",
"@react-navigation/elements": "^1.3.30",
"@react-navigation/native": "^6.1.17",
"@react-navigation/stack": "^6.3.29",
"@tanstack/react-query": "^5.52.1",
"axios": "^1.6.8",
"buffer": "^6.0.3",
"epubjs": "^0.3.93",
"expo": "^51.0.32",
"expo-av": "~14.0.5",
"expo-document-picker": "~12.0.1",
"expo-file-system": "~17.0.1",
"expo-linear-gradient": "~13.0.2",
"expo-status-bar": "~1.12.1",
"lucide-react-native": "^0.426.0",
"moti": "^0.28.1",
"react": "18.2.0",
"react-native": "0.74.1",
"react-native-drawer-layout": "^3.3.0",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "~2.16.1",
"react-native-modal": "^13.0.1",
"react-native-paper": "^5.12.5",
"react-native-reanimated": "~3.10.1",
"react-native-safe-area-context": "4.10.1",
"react-native-screens": "3.31.1",
"react-native-svg": "^15.5.0",
"react-native-webview": "13.8.6"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@expo/metro-runtime": "~3.2.3",
"eslint": "8.0.0",
"eslint-config-universe": "^12.0.0",
"react-dom": "18.2.0",
"react-native-web": "~0.19.10"
},
"private": true
}

Your .epub file

No response

Minimal reproducible example

No response

I confirm that i have

  • I looked for a solution to my problem in other open and resolved issues
  • I checked the examples provided solve my problem
  • I have verified that my problem is not caused by a third-party library
  • I cloned the project environment examples and still the problem persists
  • I'm using the latest available version of the library and its complements
@dcallus
Copy link
Author

dcallus commented Sep 20, 2024

Okay I've done some experimenting.
Moving the function calculation outside of the menuItems and calculating it beforehand does NOT help.
The two bugs I listed are in fact related.

The only time we get the wrong (previous) menu pop up, is if a quick release is done. Very similar to how we get no menu popup at all when releasing quickly.

Copy link

This issue is stale because it has been open for 90 days with no activity.

@github-actions github-actions bot added the stale label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant