-
Notifications
You must be signed in to change notification settings - Fork 95
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
When click on button for multiple times popover is opening and screen got strucked? #37
Comments
|
So you are just spamming the touchable? What version of react-native and react-native-popover-view are you using? I can test this out when I have a free second. |
We're also having this problem. If you spam the touchable, eventually the popover will just disappear. There's no way to get it back unless you reload. Using onOpenComplete or onCloseComplete to disable the touchable doesn't work because javascript can't disable native animations. It is likely that the user can press something multiple times quickly. |
Is this with tooltip mode or regular? |
@SteffeyDev |
You can disable the animations by using the |
We're having same problem, I tried to disable animation but problem not fixed. rn version: 63.2 |
@ergenekonyigit can you provide reproduction steps? Can you reproduce consistently? |
This is happening to me too. It's not super easy to reproduce, but it seems to happen more easily if you stop pressing the button while the animation is ongoing. There's no error and the screen becomes unresponsive. I'm on Update: I recorded it -> https://user-images.githubusercontent.com/1490370/188266932-dd42a45e-cf19-48e3-9a23-c233d4175d41.mp4 Note that I tried for ~20 seconds before as well (trimmed the video). Update 2: I tried with animation duration set to |
I'm unable to play that video, can you try re-upload or upload on a different platform? Also, can you include debug logs? |
Here's a new video: https://user-images.githubusercontent.com/1490370/189649072-91c42527-bf73-4880-8b5f-7ec99ff53b7c.mp4 I'm using longpress to display the popover. Mode is Logs:
|
Hello! I work with @AdamGerthel and I created a snack where you will be able to reproduce the error: EDIT: I made the implementation simpler, basically what we want to achieve is: You can reproduce the error on FIRST TRY if you use the web view. I believe that is because the onPressOut event happens right after the animation starts. Problem: Using onRequestClose from the Popover component made it update the state, but doesn't update the component's render. |
I found a hacky way to solve it. What seems to happen is, since the onPressOut event happens in the middle of the animation, the showPopover state variable gets set to false in the middle of the animation. So the animation ends (showing the popover), now the popover is shown even if the showPopover variable is false. The HACKY fixI added onOpenComplete={show} which will update the popover state variable to true again once the animation ends. Then, if we press anywhere on the screen again, it hides the popover. We get this warning though:
Is there a proper way to solve this desynchronization between Popover visibility and the state variable? |
So, this should be handled internally already... If |
That's correct. This can happen from button-mashing in a game (as in our case), but it could also be someone with trembling hands (i.e. Parkinson disease etc.). |
Hii, try this animationConfig={{ |
After some initial investigation, I've found that this never happens, because Here's a video where I've recorded it happening in the test app / demo. As you can see from the code sample, I'm using Screen.Recording.2024-10-04.at.10.30.16.mp4It looks like |
@SteffeyDev do you remember why the timeouts in |
The function as a whole just gets the rectangle bounds for a given component, specified by a ref. |
Here is my sample code you can look into it.
The text was updated successfully, but these errors were encountered: