-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
[Android] pointerEvents + opacity - unstable #21026
Comments
Hey @danielgindi, I've struggled with this for a while too, before I've read your issue. Actually, there is a flag to control, whether view is optimized out or not, it's collapsable. It works as a workaround. |
@kabbi Thanks for your comment! This seems like the best workaround for this issue... will try it soon. |
@danielgindi i solved this problem by setting in my case i had a picture on the screen and when it is clicked i was displaying a detail view for the clicked image and between detail image and original image i was displaying a transition image which basically resizes to detail view's image by translateX and translateY. When the detail view is closed everything was turning back to initial state but when i try to click same image it was not responding due to the |
So many random things stopped working. They were mainly caused by a rerender happening in a child view while some react-spring animation was happening. Also I could not scroll on some places anymore, so I had to add collapsable={false} to some views as seem here: facebook/react-native#21026 (comment) [Web] Workaround for white edge bug on images necolas/react-native-web#1228
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Hey bot, it's not fixed, but there's a workaround. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Annoying bot |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
Environment
Description
On Android, using
pointerEvents='box-only'
is unstable in the presence ofopacity
style.Specifically, I'm animating a view's opacity, and after animating and reverting to original value - the pointerEvents property is no longer respected.
This is similar to #10216
Reproducible Demo
Now animate this._anims.opacity to 0 and back to 1.
More info & workaround
backgroundColor: 'transparent'
- it works even after setting opacity to 0.My guess is (a bit of educated guess, because I actually looked at the code), that by setting opacity to
0
React marks the view as something that's meant only for layout, and not for actually viewing things, so it can optimize it out.And coming back to opacity 1 - the view comes back (I see it in layout inspector) but it is not marked as
BOX_ONLY
anymore. A backgroundColor of 'transparent' forces it to always be treated like an actual view.The backgroundColor workaround in my opinion is exposing another bug - which is an optimization bug, not something that affects functionality.
And it is kind of nice to have right now as it allows controlling how react optimizes the view hierarchy. Food for thought: Maybe consider adding a special prop for that?
Edit:
As @kabbi mentioned, there actually is a property for disabling optimization on view.
The text was updated successfully, but these errors were encountered: