You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to be a really old problem (eg. #271), but I haven't found any solution: inputs can still be received during screen transitions. The most common problem people see from this is that tapping a button twice quickly can cause screens to be pushed twice, and people seem to try to work around that specific problem.
I think that's the wrong fix, though, since that's just one symptom. Any UI element can be interacted with during the transition, not just navigation buttons, which can cause other unwanted interactions. For example, in our app it's possible to tap a button that has both press and long press behaviors, then touch the button again during the transition. The long press then gets triggered even though the screen is no longer visible (the button becomes the responder during the transition and the long press still happens, and a dialog pops up on the next screen where it doesn't belong).
The fix I'd prefer is to completely disable inputs during screen push/pop transitions, on both the previous and new screen. That would avoid all racey UI interactions during the transition instead of just fixing the navigation case. I'm not sure how to do this, though. As a test I tried making the app's top-level render set pointerEvents: none during transitions. That didn't work on iOS: buttons still receive inputs briefly after being pressed, even if pointer events are disabled. It partially works (you have to tap much faster, the pointerEvents does kick in after a moment), but it still happens. I also tried putting an invisible blocker on top of the app, but the same thing happens. I'm not sure how that's happening, I'll probably dig further into it but maybe this is the wrong approach.
Has anyone found any workable solutions to this, or have any other ideas?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This seems to be a really old problem (eg. #271), but I haven't found any solution: inputs can still be received during screen transitions. The most common problem people see from this is that tapping a button twice quickly can cause screens to be pushed twice, and people seem to try to work around that specific problem.
I think that's the wrong fix, though, since that's just one symptom. Any UI element can be interacted with during the transition, not just navigation buttons, which can cause other unwanted interactions. For example, in our app it's possible to tap a button that has both press and long press behaviors, then touch the button again during the transition. The long press then gets triggered even though the screen is no longer visible (the button becomes the responder during the transition and the long press still happens, and a dialog pops up on the next screen where it doesn't belong).
The fix I'd prefer is to completely disable inputs during screen push/pop transitions, on both the previous and new screen. That would avoid all racey UI interactions during the transition instead of just fixing the navigation case. I'm not sure how to do this, though. As a test I tried making the app's top-level render set pointerEvents: none during transitions. That didn't work on iOS: buttons still receive inputs briefly after being pressed, even if pointer events are disabled. It partially works (you have to tap much faster, the pointerEvents does kick in after a moment), but it still happens. I also tried putting an invisible blocker on top of the app, but the same thing happens. I'm not sure how that's happening, I'll probably dig further into it but maybe this is the wrong approach.
Has anyone found any workable solutions to this, or have any other ideas?
Beta Was this translation helpful? Give feedback.
All reactions