-
Notifications
You must be signed in to change notification settings - Fork 94
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
Not seeing popover on Android #146
Comments
From the logs, it looks like the problem is that the |
No it still doesn't work. I tried putting it outside the scroll view and removed all custom styling and the vertical offset. Here is the entire screen now:
Here is what I see on screen: Logs are showing this: |
Ok some information. I was able to get the popover to show up, but ONLY when the app was deleted and reinstalled into the emulator. Same screen code as above. Logs when the popover showed up right after re-installing the app:
However, then I cold-started the app and now the popover did not show. Here are the logs for that. I verified that every single line is EXACTLY the same as the logs above when the popover did show up:
Removing the scroll view makes no difference - the behavior is the same, ie., the popover shows up after reinstalling the app, but never after that unless I delete and reinstall. Emulator is Pixel 5 API 31, Gradle 7.1.1, buildToolsVersion = "31.0.0", minSdkVersion = 23, compileSdkVersion = 31, targetSdkVersion = 31 |
@smadan Does this happen on a real device in addition to the emulator? |
@SteffeyDev I sadly don't have access to a real, newer Android device to test this on. |
I just tried on a Galaxy S9, Android 10. It doesn't work - I don't see popovers at all. |
I'm honestly not sure what's going on here, and not sure how to debug unless you can reproduce in an expo snack. Are you seeing negative y values on device as well? |
im having this problem too |
Having same issue (Galaxy S21), no popover on Android, but still have it on Expo |
Any progress here? I don't see a popover on android after updating to Expo 47.
|
@zakharchenkoAndrii are you sure your issue is related? The other users are reporting issues when upgrading to a newer Android version, not when updating to expo. Your's might be a different issue entirely. Does it still work on previous expo version? |
Hi @SteffeyDev! Yes, it is working with expo 46 and react-native 0.69.5. The current behaviour is that popover is not shown and blocks the UI thread without the ability to close it with upd: Hermes is not a culprit here, doesn't work with JSC either way... upd2: Seems like something with upd3: seems like it has a problem with starting right with |
Hey. I am seeing the same error using Expo 47 and RN 0.70.5. react-native-toast-message This could be a RN issue. One error I received was about not being able to set some css property on a shadow node. |
I'm was facing the same issue, here's how I managed to solve it. From the documentation: https://reactnative.dev/docs/view.html#collapsable views are removed if they're only used to layout children or don't draw anything on screen. In my case, the view was purely for layout purposes, and was therefore removed by react-native. In which case, the ref did not exist and the popover was unable to anchor itself. To fix the issue, add References:
Thanks to @bennidi for pointing to the other libraries. Hope this helps! |
@vsofroniev Thanks for finding this, hopefully this fixes for a few people. I will add this to the README under troubleshooting. |
@vsofroniev I'm not sure if that's the fix for this issue. See my code in my original post above - I already have collapsable={false} set everywhere. This seems to be a different problem. |
I already have collapsable={false} is not work |
I'm seeing the same as zakharchenkoAndrii; I was testing with isVisible set to true, and was not seeing the tooltip. I changed to the below and it works now (note: it only works when using setTimeout, not when calling
EDIT: Only works when |
sorry is not work |
Any updates on this? @SteffeyDev ? |
diff --git a/dist/Utility.js b/dist/Utility.js
index 35c6c1de3708a82f6453e871c25795d6249e8746..2cd6009a69fd8d5e154ffb097c8e460250b3cb80 100644
--- a/dist/Utility.js
+++ b/dist/Utility.js
@@ -39,8 +39,8 @@ import { Placement, Rect, Size } from './Types';
import { DEFAULT_ARROW_SIZE, DEFAULT_BORDER_RADIUS } from './Constants';
export function getRectForRef(ref) {
return new Promise(function (resolve, reject) {
- if (ref.current) {
- NativeModules.UIManager.measure(findNodeHandle(ref.current), function (_1, _2, width, height, x, y) {
+ if (ref.current) {
+ ref.current.measureInWindow(function (x, y, width, height) {
return resolve(new Rect(x, y, width, height));
});
}
I had the same problem than mentioned, and this change made the library work properly again on Android without setVisible timeout tricks or collapsable false — btw Hope it helps you solve the problem :) |
This worked for me, great find @dieppe 🙌🏽 |
worked for me too... dang we need to get that merged. thanks |
Its worked for me, thanks! |
It works for me too, thanks! |
Describe the bug
Looks like the popover is not showing at all on Android. I noticed this after I changed my Android target SDK to 31.
Device/Setup Info:
react-native
version: 0.63.3react-native-popover-view
version: 5.1.5Debug Output
[Wed Oct 05 2022 13:58:05.260] LOG [2022-10-05T17:58:02.664Z] calculateRectFromRef - waiting for ref
[Wed Oct 05 2022 13:58:05.290] LOG [2022-10-05T17:58:02.665Z] calculateRectFromRef - waiting for ref to move from: {"x":0,"y":0,"width":0,"height":0}
[Wed Oct 05 2022 13:58:05.244] LOG [2022-10-05T17:58:02.923Z] calculateRectFromRef - calculated Rect: {"x":0,"y":4000,"width":0,"height":0}
[Wed Oct 05 2022 13:58:05.276] LOG [2022-10-05T17:58:02.957Z] setDefaultDisplayArea - newDisplayArea: {"x":0,"y":0.000055486505743829184,"width":392.7272644042969,"height":802.9091186523438}
[Wed Oct 05 2022 13:58:05.278] LOG [2022-10-05T17:58:02.961Z] setDefaultDisplayArea - displayAreaOffset: {"x":0,"y":0}
[Wed Oct 05 2022 13:58:05.285] LOG [2022-10-05T17:58:02.968Z] calculateRectFromRef - waiting for ref
[Wed Oct 05 2022 13:58:05.288] LOG [2022-10-05T17:58:02.969Z] calculateRectFromRef - waiting for ref to move from: {"x":0,"y":4000,"width":0,"height":0}
[Wed Oct 05 2022 13:58:05.310] LOG [2022-10-05T17:58:02.992Z] measureContent - new requestedContentSize: {"width":90.18181610107422,"height":35.272727966308594} (used to be null)
[Wed Oct 05 2022 13:58:05.311] LOG [2022-10-05T17:58:02.995Z] handleChange - waiting 100ms to accumulate all changes
[Wed Oct 05 2022 13:58:05.432] LOG [2022-10-05T17:58:03.109Z] handleChange - requestedContentSize: {"width":90.18181610107422,"height":35.272727966308594}
[Wed Oct 05 2022 13:58:05.433] LOG [2022-10-05T17:58:03.109Z] handleChange - displayArea: {"x":0,"y":0.000055486505743829184,"width":392.7272644042969,"height":802.9091186523438}
[Wed Oct 05 2022 13:58:05.434] LOG [2022-10-05T17:58:03.109Z] handleChange - fromRect: {"x":0,"y":4000,"width":0,"height":0}
[Wed Oct 05 2022 13:58:05.434] LOG [2022-10-05T17:58:03.110Z] handleChange - placement: "auto"
[Wed Oct 05 2022 13:58:05.434] LOG [2022-10-05T17:58:03.111Z] computeAutoGeometry - displayArea: {"x":0,"y":0.000055486505743829184,"width":392.7272644042969,"height":802.9091186523438}
[Wed Oct 05 2022 13:58:05.434] LOG [2022-10-05T17:58:03.111Z] computeAutoGeometry - fromRect: {"x":0,"y":4000,"width":0,"height":0}
[Wed Oct 05 2022 13:58:05.435] LOG [2022-10-05T17:58:03.112Z] computeAutoGeometry - List of available space: {"left":{"sizeAvailable":-16,"sizeRequested":90.18181610107422,"fits":false,"extraSpace":-106.18181610107422},"right":{"sizeAvailable":376.7272644042969,"sizeRequested":90.18181610107422,"fits":true,"extraSpace":286.54544830322266},"top":{"sizeAvailable":3983.9999445134945,"sizeRequested":35.272727966308594,"fits":true,"extraSpace":3948.727216547186},"bottom":{"sizeAvailable":-3213.0908258611507,"sizeRequested":35.272727966308594,"fits":false,"extraSpace":-3248.3635538274593}}
[Wed Oct 05 2022 13:58:05.435] LOG [2022-10-05T17:58:03.113Z] computeAutoGeometry - Found best postition for placement: "top"
[Wed Oct 05 2022 13:58:05.435] LOG [2022-10-05T17:58:03.114Z] computeGeometry - initial chosen geometry: {"popoverOrigin":{"x":10,"y":812.9091741388495},"anchorPoint":{"x":26,"y":4000},"placement":"top","forcedContentSize":{"width":372.7272644042969,"height":3981.9999445134945},"viewLargerThanDisplayArea":{"height":false,"width":false}}
[Wed Oct 05 2022 13:58:05.436] LOG [2022-10-05T17:58:03.116Z] computeGeometry - final chosen geometry: {"popoverOrigin":{"x":10,"y":812.9091741388495},"anchorPoint":{"x":26,"y":4000},"placement":"top","forcedContentSize":{"width":372.7272644042969,"height":3981.9999445134945},"viewLargerThanDisplayArea":{"height":false,"width":false}}
[Wed Oct 05 2022 13:58:05.441] LOG [2022-10-05T17:58:03.122Z] handleChange - animating in
[Wed Oct 05 2022 13:58:05.441] LOG [2022-10-05T17:58:03.123Z] getTranslateOrigin - popoverSize: {"width":90.18181610107422,"height":43.272727966308594}
[Wed Oct 05 2022 13:58:05.444] LOG [2022-10-05T17:58:03.124Z] getTranslateOrigin - anchorPoint: {"x":26,"y":4000}
[Wed Oct 05 2022 13:58:05.447] LOG [2022-10-05T17:58:03.127Z] animateIn - translateStart: {"x":-19.09090805053711,"y":5584.181817835028}
[Wed Oct 05 2022 13:58:05.448] LOG [2022-10-05T17:58:03.127Z] animateIn - translatePoint: {"x":10,"y":812.9091741388495}
[Wed Oct 05 2022 13:58:05.454] LOG [2022-10-05T17:58:03.136Z] calculateRectFromRef - calculated Rect: {"x":96.36363983154297,"y":4080,"width":200,"height":35.6363639831543}
[Wed Oct 05 2022 13:58:05.465] LOG [2022-10-05T17:58:03.146Z] [BasePopover] componentDidUpdate - changedProps: ["fromRect"]
[Wed Oct 05 2022 13:58:05.466] LOG [2022-10-05T17:58:03.147Z] componentDidUpdate - isVisible not changed, handling other changes
[Wed Oct 05 2022 13:58:05.466] LOG [2022-10-05T17:58:03.147Z] handleChange - waiting 100ms to accumulate all changes
[Wed Oct 05 2022 13:58:05.470] LOG [2022-10-05T17:58:03.151Z] Setting up keyboard listeners
[Wed Oct 05 2022 13:58:05.579] LOG [2022-10-05T17:58:03.258Z] handleChange - requestedContentSize: {"width":90.18181610107422,"height":35.272727966308594}
[Wed Oct 05 2022 13:58:05.580] LOG [2022-10-05T17:58:03.259Z] handleChange - displayArea: {"x":0,"y":0.000055486505743829184,"width":392.7272644042969,"height":802.9091186523438}
[Wed Oct 05 2022 13:58:05.582] LOG [2022-10-05T17:58:03.262Z] handleChange - fromRect: {"x":96.36363983154297,"y":4080,"width":200,"height":35.6363639831543}
[Wed Oct 05 2022 13:58:05.582] LOG [2022-10-05T17:58:03.265Z] handleChange - placement: "auto"
[Wed Oct 05 2022 13:58:05.583] LOG [2022-10-05T17:58:03.267Z] computeAutoGeometry - Top/bottom tryping to keep same, geometry: {"popoverOrigin":{"x":151.27273178100586,"y":812.9091741388495},"anchorPoint":{"x":196.36363983154297,"y":4080},"placement":"top","forcedContentSize":{"width":372.7272644042969,"height":4061.9999445134945},"viewLargerThanDisplayArea":{"height":false,"width":false}}
[Wed Oct 05 2022 13:58:05.588] LOG [2022-10-05T17:58:03.269Z] computeGeometry - initial chosen geometry: {"popoverOrigin":{"x":151.27273178100586,"y":812.9091741388495},"anchorPoint":{"x":196.36363983154297,"y":4080},"placement":"top","forcedContentSize":{"width":372.7272644042969,"height":4061.9999445134945},"viewLargerThanDisplayArea":{"height":false,"width":false}}
[Wed Oct 05 2022 13:58:05.589] LOG [2022-10-05T17:58:03.270Z] computeGeometry - final chosen geometry: {"popoverOrigin":{"x":151.27273178100586,"y":812.9091741388495},"anchorPoint":{"x":196.36363983154297,"y":4080},"placement":"top","forcedContentSize":{"width":372.7272644042969,"height":4061.9999445134945},"viewLargerThanDisplayArea":{"height":false,"width":false}}
[Wed Oct 05 2022 13:58:05.599] LOG [2022-10-05T17:58:03.280Z] handleChange - animating in
[Wed Oct 05 2022 13:58:05.601] LOG [2022-10-05T17:58:03.281Z] getTranslateOrigin - popoverSize: {"width":90.18181610107422,"height":43.272727966308594}
[Wed Oct 05 2022 13:58:05.601] LOG [2022-10-05T17:58:03.282Z] getTranslateOrigin - anchorPoint: {"x":196.36363983154297,"y":4080}
[Wed Oct 05 2022 13:58:05.602] LOG [2022-10-05T17:58:03.285Z] animateIn - translateStart: {"x":151.27273178100586,"y":5664.181817835028}
[Wed Oct 05 2022 13:58:05.603] LOG [2022-10-05T17:58:03.285Z] animateIn - translatePoint: {"x":151.27273178100586,"y":812.9091741388495}
[Wed Oct 05 2022 13:58:05.618] LOG [2022-10-05T17:58:03.299Z] Setting up keyboard listeners
[Wed Oct 05 2022 13:58:05.639] LOG [2022-10-05T17:58:03.325Z] animateIn - onOpenComplete - Calculated Popover Rect: {"x":0,"y":-1605.8182373046875,"width":90.18181610107422,"height":35.272727966308594}
[Wed Oct 05 2022 13:58:05.641] LOG [2022-10-05T17:58:03.326Z] animateIn - onOpenComplete - Calculated Arrow Rect: {"x":37.09090805053711,"y":-1572.3636474609375,"width":18.18181800842285,"height":9.818181991577148}
[Wed Oct 05 2022 13:58:05.941] LOG [2022-10-05T17:58:03.626Z] animateIn - onOpenComplete - Calculated Popover Rect: {"x":0,"y":-1605.8182373046875,"width":90.18181610107422,"height":35.272727966308594}
[Wed Oct 05 2022 13:58:05.942] LOG [2022-10-05T17:58:03.627Z] animateIn - onOpenComplete - Calculated Arrow Rect: {"x":37.09090805053711,"y":-1572.3636474609375,"width":18.18181800842285,"height":9.818181991577148}
[Wed Oct 05 2022 13:58:36.599] LOG [2022-10-05T17:58:34.277Z] [BasePopover] componentDidUpdate - changedProps: ["verticalOffset"]
[Wed Oct 05 2022 13:58:36.601] LOG [2022-10-05T17:58:34.278Z] componentDidUpdate - isVisible not changed, handling other changes
[Wed Oct 05 2022 13:58:36.602] LOG [2022-10-05T17:58:34.281Z] handleChange - waiting 100ms to accumulate all changes
[Wed Oct 05 2022 13:58:36.711] LOG [2022-10-05T17:58:34.391Z] handleChange - requestedContentSize: {"width":90.18181610107422,"height":35.272727966308594}
[Wed Oct 05 2022 13:58:36.714] LOG [2022-10-05T17:58:34.392Z] handleChange - displayArea: {"x":0,"y":0.000055486505743829184,"width":392.7272644042969,"height":802.9091186523438}
[Wed Oct 05 2022 13:58:36.715] LOG [2022-10-05T17:58:34.392Z] handleChange - fromRect: {"x":96.36363983154297,"y":4080,"width":200,"height":35.6363639831543}
[Wed Oct 05 2022 13:58:36.715] LOG [2022-10-05T17:58:34.393Z] handleChange - placement: "auto"
[Wed Oct 05 2022 13:58:36.716] LOG [2022-10-05T17:58:34.395Z] computeAutoGeometry - Top/bottom tryping to keep same, geometry: {"popoverOrigin":{"x":151.27273178100586,"y":812.9091741388495},"anchorPoint":{"x":196.36363983154297,"y":4080},"placement":"top","forcedContentSize":{"width":372.7272644042969,"height":4061.9999445134945},"viewLargerThanDisplayArea":{"height":false,"width":false}}
[Wed Oct 05 2022 13:58:36.716] LOG [2022-10-05T17:58:34.397Z] computeGeometry - initial chosen geometry: {"popoverOrigin":{"x":151.27273178100586,"y":812.9091741388495},"anchorPoint":{"x":196.36363983154297,"y":4080},"placement":"top","forcedContentSize":{"width":372.7272644042969,"height":4061.9999445134945},"viewLargerThanDisplayArea":{"height":false,"width":false}}
[Wed Oct 05 2022 13:58:36.716] LOG [2022-10-05T17:58:34.397Z] computeGeometry - final chosen geometry: {"popoverOrigin":{"x":151.27273178100586,"y":812.9091741388495},"anchorPoint":{"x":196.36363983154297,"y":4080},"placement":"top","forcedContentSize":{"width":372.7272644042969,"height":4061.9999445134945},"viewLargerThanDisplayArea":{"height":false,"width":false}}
[Wed Oct 05 2022 13:58:36.727] LOG [2022-10-05T17:58:34.410Z] handleChange - no change
Here's the relevant code from my React component (this is a full screen):
It's a bit weird because after trying a few times, it suddenly decided to appear on one attempt. But then with the exact same code, it didn't appear on another attempt so I'm not sure what's going on here.
The text was updated successfully, but these errors were encountered: